]> saetta.ns0.it Git - libgdaexgrid/commitdiff
Memory leak.
authorAndrea Zagli <andrea.zagli@email.it>
Sun, 21 Feb 2016 11:50:33 +0000 (12:50 +0100)
committerAndrea Zagli <andrea.zagli@email.it>
Sun, 21 Feb 2016 11:50:33 +0000 (12:50 +0100)
src/grid.c

index ce63755ee7cebca21f7e83693163ebac6c07de27..ca7dbbdf102b2a1f0c0ed2402456d1c22ef3c46b 100644 (file)
@@ -338,17 +338,19 @@ gdaex_grid_fill_from_sql_with_missing_func (GdaExGrid *grid,
 }
 
 static
-gchar *_gettext (const gchar *str)
+const gchar *_gettext (const gchar *str)
 {
        gchar *ret;
 
-       ret = g_strstrip (g_strdup (str));
-       if (g_strcmp0 (ret, "") == 0)
+       ret = g_strdup (str);
+       if (g_strcmp0 (g_strstrip (ret), "") == 0)
                {
-                       return ret;
+                       g_free (ret);
+                       return "";
                }
        else
                {
+                       g_free (ret);
                        return gettext (str);
                }
 }