[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9_2-7-g7febcac

Philippe Delorme nobody at users.sourceforge.net
Wed Jun 8 00:26:12 CEST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".

The branch, master has been updated
       via  7febcac4ae3d98fcc056b3365785d5772676c883 (commit)
      from  5d328df351d4362c6258445557fe0d2f355c083e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7febcac4ae3d98fcc056b3365785d5772676c883
Author: Philippe Delorme <philippedelorme at users.sourceforge.net>
Date:   Tue Jun 7 23:11:43 2011 +0200

    Fix memory leaks

-----------------------------------------------------------------------

Changes:
diff --git a/src/gsb_file_config.c b/src/gsb_file_config.c
index b397e30..8d2fd7b 100644
--- a/src/gsb_file_config.c
+++ b/src/gsb_file_config.c
@@ -142,6 +142,7 @@ devel_debug (NULL);
         filename = g_build_filename ( my_get_grisbirc_dir(), C_OLD_GRISBIRC ( ), NULL );
 #endif
         
+        g_key_file_free ( config );
         config = g_key_file_new ();
         
         result = g_key_file_load_from_file ( config,
@@ -155,6 +156,7 @@ devel_debug (NULL);
             if ( result )
                 gsb_file_config_remove_old_config_file ( filename );
             g_free (filename);
+            g_key_file_free ( config );
             return result;
         }
         else
@@ -174,7 +176,10 @@ devel_debug (NULL);
         filename = g_strconcat ( my_get_XDG_grisbirc_dir(), G_DIR_SEPARATOR_S,
                                  PACKAGE, ".conf", NULL );
         if ( !g_file_test (filename, G_FILE_TEST_EXISTS) )
+        {
+            g_key_file_free ( config );
             return FALSE;
+        }
 
         g_key_file_free (config);
         config = g_key_file_new ();
diff --git a/src/gsb_file_load.c b/src/gsb_file_load.c
index d8c0d11..858cbc5 100644
--- a/src/gsb_file_load.c
+++ b/src/gsb_file_load.c
@@ -358,10 +358,14 @@ gboolean gsb_file_load_open_file ( gchar *filename )
             length = crypt_function ( filename, &file_content, FALSE, length );
             
             if ( ! length )
+            {
+                g_free (file_content);
                 return FALSE;
             }
+            }
             else
             {
+                g_free (file_content);
                 dialogue_error_hint ( _("Grisbi was unable to load required plugin to "
                         "handle that file.\n\n"
                         "Please make sure if is installed (i.e. check "
@@ -408,17 +412,13 @@ gboolean gsb_file_load_open_file ( gchar *filename )
                         file_content,
                         strlen (file_content),
                         NULL );
-        if ( !download_tmp_values.download_ok )
-        {
-            g_markup_parse_context_free (context);
-            g_free (markup_parser);
-            g_free (file_content);
-            return FALSE;
-        }
 
         g_markup_parse_context_free (context);
         g_free (markup_parser);
         g_free (file_content);
+
+        if ( !download_tmp_values.download_ok )
+            return FALSE;
     }
     else
     {


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list