[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9_3-10-gf91d5e9

Philippe Delorme nobody at users.sourceforge.net
Sat Aug 27 00:19:11 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  f91d5e979f64c587b53b43b1a6cc41a8a50a79c9 (commit)
      from  68eff0f2a8d0d162ec965558ab28dd6e28421fbc (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 f91d5e979f64c587b53b43b1a6cc41a8a50a79c9
Author: Philippe Delorme <philippedelorme at users.sourceforge.net>
Date:   Sat Aug 27 00:13:34 2011 +0200

    Fixed some memory leaks

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

Changes:
diff --git a/src/bet_hist.c b/src/bet_hist.c
index f88e979..8f82176 100644
--- a/src/bet_hist.c
+++ b/src/bet_hist.c
@@ -885,14 +885,13 @@ void bet_historical_populate_div_model ( gpointer key,
 /*         printf ("division = %d sub_div = %d div_name = %s\n", div_number, sub_sh -> div, div_name);  */
         if ( div_name && g_utf8_strrchr ( div_name, -1, ':' ) )
         {
-	        tab_str = g_strsplit ( div_name, ":", 2 );
+            tab_str = g_strsplit ( div_name, ":", 2 );
             if ( g_strv_length ( tab_str ) > 1 )
             {
                 g_free ( div_name );
                 div_name = g_strdup ( g_strstrip ( tab_str[1] ) );
             }
-            if ( tab_str )
-                g_strfreev ( tab_str );
+            g_strfreev ( tab_str );
         }
 
         str_balance = utils_real_get_string_with_currency ( sub_sbr -> current_balance, 
diff --git a/src/gsb_data_partial_balance.c b/src/gsb_data_partial_balance.c
index 78a8d35..145246c 100644
--- a/src/gsb_data_partial_balance.c
+++ b/src/gsb_data_partial_balance.c
@@ -573,6 +573,7 @@ void gsb_partial_balance_selectionne_cptes ( GtkWidget *tree_view,
             valid = gtk_tree_model_iter_next ( model, &iter );
         }
     }
+    g_strfreev ( tab );
 }
 
 
@@ -1077,6 +1078,7 @@ gchar *gsb_data_partial_balance_get_marked_balance ( gint partial_balance_number
         }
         solde = gsb_real_add ( solde, tmp_real );
     }
+    g_strfreev ( tab );
 
     if ( partial_balance -> colorise && solde.mantissa < 0 )
         string = g_strdup_printf ( "<span color=\"red\">%s</span>",
@@ -1138,6 +1140,7 @@ gsb_real gsb_data_partial_balance_get_current_amount ( gint partial_balance_numb
         }
         solde = gsb_real_add ( solde, tmp_real );
     }
+    g_strfreev ( tab );
 
     return solde;
 }
@@ -1325,6 +1328,8 @@ gboolean gsb_data_partial_balance_init_from_liste_cptes ( gint partial_balance_n
             }
         }
     }
+    g_strfreev ( tab );
+
     if ( currency_mixte )
         gsb_data_partial_balance_set_currency ( partial_balance_number,
                         no_devise_solde_partiels );
diff --git a/src/gsb_file.c b/src/gsb_file.c
index 0cdd584..c5615d1 100644
--- a/src/gsb_file.c
+++ b/src/gsb_file.c
@@ -643,8 +643,8 @@ gboolean gsb_file_save_backup ( void )
         {
             g_free ( name );
             name = g_strdup ( tab_str[0] );
-            g_strfreev ( tab_str );
         }
+        g_strfreev ( tab_str );
     }
     /* create a filename for the backup :
      * filename_yyyymmddTmmhhss.gsb */
diff --git a/src/gtk_combofix.c b/src/gtk_combofix.c
index e60b287..8c36111 100644
--- a/src/gtk_combofix.c
+++ b/src/gtk_combofix.c
@@ -488,6 +488,7 @@ void gtk_combofix_append_text ( GtkComboFix *combofix, const gchar *text )
             g_free ( tmpstr );
         }
     }
+    g_strfreev ( tab_char );
 
     if ( priv -> old_entry && strlen ( priv -> old_entry ) )
         g_free ( priv -> old_entry );
diff --git a/src/utils_str.c b/src/utils_str.c
index d68761c..0678241 100644
--- a/src/utils_str.c
+++ b/src/utils_str.c
@@ -794,9 +794,13 @@ gboolean gsb_string_is_trouve ( const gchar *payee_name, const gchar *needle )
 gchar * gsb_string_remplace_joker ( const gchar *chaine, gchar *new_str )
 {
     gchar **tab_str;
+    gchar *result;
 
     tab_str = g_strsplit_set ( chaine, "%*", 0 );
-    return g_strjoinv ( new_str, tab_str );
+    result = g_strjoinv ( new_str, tab_str );
+    g_strfreev ( tab_str );
+
+    return result;
 }
 
 
@@ -810,9 +814,13 @@ gchar * gsb_string_remplace_joker ( const gchar *chaine, gchar *new_str )
 gchar *gsb_string_supprime_joker ( const gchar *chaine )
 {
     gchar **tab_str;
+    gchar *result;
 
     tab_str = g_strsplit_set ( chaine, "%*", 0 );
-    return g_strjoinv ( "", tab_str );
+    result = g_strjoinv ( "", tab_str );
+    g_strfreev ( tab_str );
+
+    return result;
 }
 
 
@@ -859,7 +867,8 @@ gchar *gsb_string_extract_int ( const gchar *chaine )
  */
 gchar *gsb_string_uniform_new_line ( const gchar *chaine, gint nbre_char )
 {
-    gchar **tab_str;
+    gchar **tab_str = NULL;
+    gchar *result = NULL;
 
     if ( chaine == NULL )
         return NULL;
@@ -867,19 +876,20 @@ gchar *gsb_string_uniform_new_line ( const gchar *chaine, gint nbre_char )
     if ( g_strstr_len ( chaine, nbre_char, "\r\n" ) )
     {
         tab_str = g_strsplit_set ( chaine, "\r", 0 );
-        return g_strjoinv ( "", tab_str );
+        result = g_strjoinv ( "", tab_str );
     }
     else if ( g_strstr_len ( chaine, nbre_char, "\r" ) 
      && 
      !g_strstr_len ( chaine, nbre_char, "\n" ) )
     {
         tab_str = g_strsplit_set ( chaine, "\r", 0 );
-        return g_strjoinv ( "\n", tab_str );
+        result = g_strjoinv ( "\n", tab_str );
     }
     else if ( g_strstr_len ( chaine, nbre_char, "\n" ) )
-        return g_strdup ( chaine );
-    else
-        return NULL;
+        result = g_strdup ( chaine );
+
+    g_strfreev ( tab_str );
+    return result;
 }
 
 


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list