On Tue Aug 6, 2024 at 7:00 PM AEST, Patrick Steinhardt wrote: > Refactor the code to make the lists we put those names into duplicate > the memory. This allows us to properly free the string as required and > thus plugs the memory leak. > > While this requires us to allocate more data overall, it shouldn't be > all that bad given that the number of allocations corresponds with the > number of command line parameters, which typically aren't all that many. Ahh so using the `STRING_LIST_INIT_DUP` initialiser means that every time we call `string_list_append()` on the list, we retain ownership of the string and the list gets its own copy. That means we're able to free our own copy later on.