[geany/geany] 47609e: Plug a possible memory leak

Colomban Wendling git-noreply at xxxxx
Sun Nov 3 00:52:12 UTC 2013


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sun, 03 Nov 2013 00:52:12 UTC
Commit:      47609ec102eb31dcd7d558a7cb8a1bcdbffff81d
             https://github.com/geany/geany/commit/47609ec102eb31dcd7d558a7cb8a1bcdbffff81d

Log Message:
-----------
Plug a possible memory leak


Modified Paths:
--------------
    src/utils.c

Modified: src/utils.c
4 files changed, 3 insertions(+), 1 deletions(-)
===================================================================
@@ -1798,7 +1798,7 @@ gboolean utils_is_remote_path(const gchar *path)
  * @see tm_get_real_path() - also resolves links. */
 void utils_tidy_path(gchar *filename)
 {
-	GString *str = g_string_new(filename);
+	GString *str;
 	const gchar *c, *needle;
 	gchar *tmp;
 	gssize pos;
@@ -1806,6 +1806,8 @@ void utils_tidy_path(gchar *filename)
 
 	g_return_if_fail(g_path_is_absolute(filename));
 
+	str = g_string_new(filename);
+
 	if (str->len >= 2 && strncmp(str->str, "\\\\", 2) == 0)
 		preserve_double_backslash = TRUE;
 



--------------
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