2026-09-23 08:17 UTC
path = g_strdup (argv[n]);
How many code smells can you detect in that one single line?
Replies (1)
-
@ska@social.treehouse.systems 2026-09-23 08:32
using glibusing strdupon an argv element, which will be available for the whole lifetime of the programyou cannot see it here without the full context, but it loops around n while path is defined outside of the loop, so it needs to free on every iteration or it just overwrites path and leaks