[Github-comments] [geany/geany] build.c: Fix memory leak & make some small refactorings (#2271)

Colomban Wendling notifications at xxxxx
Sat Aug 24 10:27:55 UTC 2019


b4n commented on this pull request.



> @@ -817,7 +816,8 @@ static gchar *prepare_run_cmd(GeanyDocument *doc, gchar **working_dir, guint cmd
 	{
 		if (vc->skip_run_script)
 		{
-			utils_free_pointers(2, cmd_string_utf8, working_dir_utf8, NULL);
+			utils_free_pointers(3, cmd_string_utf8, working_dir_utf8,
+				*working_dir, NULL);

Yeah, and as in this code path the function doesn't return `NULL` (or shouldn't, at least), it's expected that `*working_dir` contains the working directory.

I think this change is wrong.  @ntrel did you actually measure a memory leak, or can this be coming from a misinterpretation of the code? (which might suggest it should be made clearer, but well)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2271#discussion_r317353204
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190824/1195f42d/attachment.html>


More information about the Github-comments mailing list