[geany/geany] 98b825: Plug a few possible small memory leaks

Colomban Wendling git-noreply at xxxxx
Thu Dec 5 20:39:59 UTC 2013


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Thu, 05 Dec 2013 20:39:59 UTC
Commit:      98b82550a8344c2615c986fb235096e7d517911a
             https://github.com/geany/geany/commit/98b82550a8344c2615c986fb235096e7d517911a

Log Message:
-----------
Plug a few possible small memory leaks


Modified Paths:
--------------
    src/keyfile.c
    src/toolbar.c

Modified: src/keyfile.c
6 files changed, 3 insertions(+), 3 deletions(-)
===================================================================
@@ -843,7 +843,7 @@ static void load_dialog_prefs(GKeyFile *config)
 		vte_info.dir = utils_get_setting_string(config, "VTE", "last_dir", NULL);
 		if ((vte_info.dir == NULL || utils_str_equal(vte_info.dir, "")) && pw != NULL)
 			/* last dir is not set, fallback to user's home directory */
-			vte_info.dir = g_strdup(pw->pw_dir);
+			SETPTR(vte_info.dir, g_strdup(pw->pw_dir));
 		else if (vte_info.dir == NULL && pw == NULL)
 			/* fallback to root */
 			vte_info.dir = g_strdup("/");
@@ -888,7 +888,7 @@ static void load_dialog_prefs(GKeyFile *config)
 	cmd = utils_get_setting_string(config, "tools", "terminal_cmd", "");
 	if (EMPTY(cmd))
 	{
-		cmd = utils_get_setting_string(config, "tools", "term_cmd", "");
+		SETPTR(cmd, utils_get_setting_string(config, "tools", "term_cmd", ""));
 		if (!EMPTY(cmd))
 		{
 			tmp_string = cmd;
@@ -903,7 +903,7 @@ static void load_dialog_prefs(GKeyFile *config)
 			g_free(tmp_string);
 		}
 		else
-			cmd = g_strdup(GEANY_DEFAULT_TOOLS_TERMINAL);
+			SETPTR(cmd, g_strdup(GEANY_DEFAULT_TOOLS_TERMINAL));
 	}
 	tool_prefs.term_cmd = cmd;
 	tool_prefs.browser_cmd = utils_get_setting_string(config, "tools", "browser_cmd", GEANY_DEFAULT_TOOLS_BROWSER);


Modified: src/toolbar.c
3 files changed, 3 insertions(+), 0 deletions(-)
===================================================================
@@ -794,7 +794,10 @@ static void tb_editor_drag_data_get_cb(GtkWidget *widget, GdkDragContext *contex
 
 	gtk_tree_model_get(model, &iter, TB_EDITOR_COL_ACTION, &name, -1);
 	if (G_UNLIKELY(EMPTY(name)))
+	{
+		g_free(name);
 		return;
+	}
 
 	atom = gdk_atom_intern(tb_editor_dnd_targets[0].target, FALSE);
 	gtk_selection_data_set(data, atom, 8, (guchar*) name, strlen(name));



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list