Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Thu, 02 May 2024 21:52:06 UTC Commit: 4515126e98b9ba5030b783a4424efc3bdf5c4d4d https://github.com/geany/geany-plugins/commit/4515126e98b9ba5030b783a4424efc...
Log Message: ----------- workbench: Fix memory leak detected by cppcheck
And `contents` as well, although it wasn't detected.
Modified Paths: -------------- workbench/src/workbench.c
Modified: workbench/src/workbench.c 4 lines changed, 3 insertions(+), 1 deletions(-) =================================================================== @@ -833,6 +833,8 @@ gboolean workbench_load(WORKBENCH *wb, const gchar *filename, GError **error) return FALSE; }
+ g_free (contents); + if (g_key_file_has_key (kf, "General", "filetype", NULL) && g_key_file_has_key (kf, "General", "version", NULL)) { @@ -854,6 +856,7 @@ gboolean workbench_load(WORKBENCH *wb, const gchar *filename, GError **error) g_set_error (error, 0, 0, _("File %s is not a valid workbench file!"), filename); + g_key_file_free (kf); return FALSE; } workbench_set_filename(wb, filename); @@ -964,7 +967,6 @@ gboolean workbench_load(WORKBENCH *wb, const gchar *filename, GError **error) }
g_key_file_free(kf); - g_free (contents); success = TRUE; } else if (error != NULL)
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org