[geany/geany-plugins] 7654e8: Geanylua: fix leaks

Pavel Roschin git-noreply at xxxxx
Sun Mar 30 16:01:18 UTC 2014


Branch:      refs/heads/master
Author:      Pavel Roschin <roshin at scriptumplus.ru>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sun, 30 Mar 2014 16:01:18 UTC
Commit:      7654e8aa523e316b1f80b1b962ba4e7288389e94
             https://github.com/geany/geany-plugins/commit/7654e8aa523e316b1f80b1b962ba4e7288389e94

Log Message:
-----------
Geanylua: fix leaks


Modified Paths:
--------------
    geanylua/glspi_dlg.c

Modified: geanylua/glspi_dlg.c
11 files changed, 7 insertions(+), 4 deletions(-)
===================================================================
@@ -425,9 +425,11 @@ static gchar *file_dlg(lua_State* L, gboolean save, const gchar *path,	const gch
 	if (name && *name) {
 		if (g_path_is_absolute(name)) {
 			fullname=g_strdup(name);
-		} else if (path) {fullname=g_build_filename(path,name,NULL);}
-			gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dlg), fullname);
-			if (save) gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dlg), name);
+		} else if (path) {
+			fullname=g_build_filename(path,name,NULL);
+		}
+		gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dlg), fullname);
+		if (save) { gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dlg), name); }
 	}
 	if (path && *path) {
 		gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dlg), path);
@@ -437,6 +439,7 @@ static gchar *file_dlg(lua_State* L, gboolean save, const gchar *path,	const gch
 			"failed to parse filter string at argument #3.\n"),
 			LUA_MODULE_NAME);
 		lua_error(L);
+		g_free(fullname);
 		return NULL;
 	}
 
@@ -454,7 +457,7 @@ static gchar *file_dlg(lua_State* L, gboolean save, const gchar *path,	const gch
 		rv=gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dlg));
 	}
 	gtk_widget_destroy(dlg);
-	if (fullname) {g_free(fullname);}
+	g_free(fullname);
 	return rv;
 }
 



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


More information about the Plugins-Commits mailing list