[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9.0-5-gcd7d128

Pierre Biava nobody at users.sourceforge.net
Fri Feb 25 23:00:08 CET 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  cd7d128bd2c2bb93b99fae250bef40c2da036b6e (commit)
       via  1ac64f44fa7db612d1b8ed8ce393395b3802d7bd (commit)
      from  d7c4a62e261449c94a696ad311edc3d7f674b0bb (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 cd7d128bd2c2bb93b99fae250bef40c2da036b6e
Author: pbiava <pierre.biava at nerim.net>
Date:   Fri Feb 25 22:57:45 2011 +0100

    fixes bug of compilation

commit 1ac64f44fa7db612d1b8ed8ce393395b3802d7bd
Author: pbiava <pierre.biava at nerim.net>
Date:   Fri Feb 25 21:33:51 2011 +0100

    fix memory leaks thanks Philippe D.

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

Changes:
diff --git a/src/bet_data.c b/src/bet_data.c
index 0c9f7e5..d0067f3 100644
--- a/src/bet_data.c
+++ b/src/bet_data.c
@@ -55,6 +55,7 @@ static GDate *bet_data_futur_get_next_date ( struct_futur_data *scheduled,
                         const GDate *date_max );
 static struct_futur_data *bet_data_future_copy_struct ( struct_futur_data *scheduled );
 static void bet_data_future_set_max_number ( gint number );
+static gchar *bet_data_get_key ( gint account_number, gint div_number );
 static gboolean bet_data_update_div ( SH *sh,
                         gint transaction_number,
                         gint sub_div,
@@ -266,11 +267,7 @@ gboolean bet_data_hist_add_div ( gint account_number,
     gchar *sub_key;
     struct_hist_div *shd;
 
-    if ( account_number == 0 )
-        key = g_strconcat ("0:", utils_str_itoa ( div_number ), NULL );
-    else
-        key = g_strconcat ( utils_str_itoa ( account_number ), ":",
-                        utils_str_itoa ( div_number ), NULL );
+    key = bet_data_get_key ( account_number, div_number );
 
     if ( ( shd = g_hash_table_lookup ( bet_hist_div_list, key ) ) )
     {
@@ -344,11 +341,7 @@ void bet_data_insert_div_hist ( struct_hist_div *shd, struct_hist_div *sub_shd )
     gchar *sub_key;
     struct_hist_div *tmp_shd;
 
-    if ( shd -> account_nb == 0 )
-        key = g_strconcat ("0:", utils_str_itoa ( shd -> div_number ), NULL );
-    else
-        key = g_strconcat ( utils_str_itoa ( shd -> account_nb ), ":",
-                        utils_str_itoa ( shd -> div_number ), NULL );
+    key = bet_data_get_key ( shd -> account_nb, shd -> div_number );
 
     if ( ( tmp_shd = g_hash_table_lookup ( bet_hist_div_list, key ) ) )
     {
@@ -385,11 +378,7 @@ gboolean bet_data_remove_div_hist ( gint account_number, gint div_number, gint s
     char *sub_key;
     struct_hist_div *shd;
     
-    if ( account_number == 0 )
-        key = g_strconcat ("0:", utils_str_itoa ( div_number ), NULL );
-    else
-        key = g_strconcat ( utils_str_itoa ( account_number ), ":",
-                        utils_str_itoa ( div_number ), NULL );
+    key = bet_data_get_key ( account_number, div_number );
 
     if ( ( shd = g_hash_table_lookup ( bet_hist_div_list, key ) ) )
     {
@@ -421,11 +410,7 @@ gboolean bet_data_search_div_hist ( gint account_number, gint div_number, gint s
     gint origin;
     struct_hist_div *shd;
 
-    if ( account_number == 0 )
-        key = g_strconcat ("0:", utils_str_itoa ( div_number ), NULL );
-    else
-        key = g_strconcat ( utils_str_itoa ( account_number ), ":",
-                        utils_str_itoa ( div_number ), NULL );
+    key = bet_data_get_key ( account_number, div_number );
 
     origin = gsb_data_account_get_bet_hist_data ( account_number );
 
@@ -543,11 +528,7 @@ gboolean bet_data_get_div_edited ( gint account_number, gint div_number, gint su
     struct_hist_div *shd;
     gboolean edited;
 
-    if ( account_number == 0 )
-        key = g_strconcat ("0:", utils_str_itoa ( div_number ), NULL );
-    else
-        key = g_strconcat ( utils_str_itoa ( account_number ), ":",
-                        utils_str_itoa ( div_number ), NULL );
+    key = bet_data_get_key ( account_number, div_number );
 
     origin = gsb_data_account_get_bet_hist_data ( account_number );
 
@@ -591,11 +572,7 @@ gboolean bet_data_set_div_edited ( gint account_nb,
     gchar *key;
     struct_hist_div *shd;
 
-    if ( account_nb == 0 )
-        key = g_strconcat ("0:", utils_str_itoa ( div_number ), NULL );
-    else
-        key = g_strconcat ( utils_str_itoa ( account_nb ), ":",
-                        utils_str_itoa ( div_number ), NULL );
+    key = bet_data_get_key ( account_nb, div_number );
 
     if ( ( shd = g_hash_table_lookup ( bet_hist_div_list, key ) ) )
     {
@@ -631,11 +608,7 @@ gsb_real bet_data_hist_get_div_amount ( gint account_nb, gint div_number, gint s
     struct_hist_div *shd;
     gsb_real amount;
 
-    if ( account_nb == 0 )
-        key = g_strconcat ("0:", utils_str_itoa ( div_number ), NULL );
-    else
-        key = g_strconcat ( utils_str_itoa ( account_nb ), ":",
-                        utils_str_itoa ( div_number ), NULL );
+    key = bet_data_get_key ( account_nb, div_number );
 
     if ( ( shd = g_hash_table_lookup ( bet_hist_div_list, key ) ) )
     {
@@ -676,11 +649,7 @@ gboolean bet_data_set_div_amount ( gint account_nb,
     gchar *key;
     struct_hist_div *shd;
 
-    if ( account_nb == 0 )
-        key = g_strconcat ("0:", utils_str_itoa ( div_number ), NULL );
-    else
-        key = g_strconcat ( utils_str_itoa ( account_nb ), ":",
-                        utils_str_itoa ( div_number ), NULL );
+    key = bet_data_get_key ( account_nb, div_number );
 
     if ( ( shd = g_hash_table_lookup ( bet_hist_div_list, key ) ) )
     {
@@ -1172,11 +1141,7 @@ gboolean bet_data_future_add_lines ( struct_futur_data *scheduled )
 
     if ( scheduled -> frequency == 0 )
     {
-        if ( scheduled -> account_number == 0 )
-            key = g_strconcat ("0:", utils_str_itoa ( future_number ), NULL );
-        else
-            key = g_strconcat ( utils_str_itoa ( scheduled -> account_number ), ":",
-                        utils_str_itoa ( future_number ), NULL );
+        key = bet_data_get_key ( scheduled -> account_number, future_number );
 
         scheduled -> number = future_number;
         g_hash_table_insert ( bet_future_list, key, scheduled );
@@ -1196,11 +1161,7 @@ gboolean bet_data_future_add_lines ( struct_futur_data *scheduled )
         date = gsb_date_copy ( scheduled -> date );
         while ( date != NULL && g_date_valid ( date ) )
         {
-            if ( scheduled -> account_number == 0 )
-                key = g_strconcat ("0:", utils_str_itoa ( future_number ), NULL );
-            else
-                key = g_strconcat ( utils_str_itoa ( scheduled -> account_number ), ":",
-                        utils_str_itoa ( future_number ), NULL );
+            key = bet_data_get_key ( scheduled -> account_number, future_number );
 
             if ( mother_row == future_number )
                 new_sch = scheduled;
@@ -1237,15 +1198,11 @@ gboolean bet_data_future_set_lines_from_file ( struct_futur_data *scheduled )
 {
     gchar *key;
 
-        if ( scheduled -> account_number == 0 )
-            key = g_strconcat ("0:", utils_str_itoa ( scheduled -> number ), NULL );
-        else
-            key = g_strconcat ( utils_str_itoa ( scheduled -> account_number ), ":",
-                        utils_str_itoa ( scheduled -> number ), NULL );
+    key = bet_data_get_key ( scheduled -> account_number, scheduled -> number );
 
-        bet_data_future_set_max_number ( scheduled -> number );
+    bet_data_future_set_max_number ( scheduled -> number );
 
-        g_hash_table_insert ( bet_future_list, key, scheduled );
+    g_hash_table_insert ( bet_future_list, key, scheduled );
 
     return TRUE;
 }
@@ -1558,11 +1515,7 @@ gboolean bet_data_future_modify_lines ( struct_futur_data *scheduled )
 {
     gchar *key;
 
-    if ( scheduled -> account_number == 0 )
-        key = g_strconcat ("0:", utils_str_itoa ( scheduled -> number ), NULL );
-    else
-        key = g_strconcat ( utils_str_itoa ( scheduled -> account_number ), ":",
-                        utils_str_itoa ( scheduled -> number ), NULL );
+    key = bet_data_get_key ( scheduled -> account_number, scheduled -> number );
 
     g_hash_table_replace ( bet_future_list, key, scheduled );
 
@@ -1584,11 +1537,7 @@ struct_futur_data *bet_data_future_get_struct ( gint account_number, gint number
     gchar *key;
     struct_futur_data *scheduled;
 
-    if ( account_number == 0 )
-        key = g_strconcat ("0:", utils_str_itoa ( number ), NULL );
-    else
-        key = g_strconcat ( utils_str_itoa ( account_number ), ":",
-                        utils_str_itoa ( number ), NULL );
+    key = bet_data_get_key ( account_number, number );
 
     if ( ( scheduled = g_hash_table_lookup ( bet_future_list, key ) ) )
         return scheduled;
@@ -1654,11 +1603,7 @@ gboolean bet_data_transfert_add_line ( struct_transfert_data *transfert )
     
     transfert_number ++;
 
-    if ( transfert -> account_number == 0 )
-        key = g_strconcat ("0:", utils_str_itoa ( transfert_number ), NULL );
-    else
-        key = g_strconcat ( utils_str_itoa ( transfert -> account_number ), ":",
-                        utils_str_itoa ( transfert_number ), NULL );
+    key = bet_data_get_key ( transfert -> account_number, transfert_number );
 
     transfert -> number = transfert_number;
     g_hash_table_insert ( bet_transfert_list, key, transfert );
@@ -1716,11 +1661,7 @@ gboolean bet_data_transfert_set_line_from_file ( struct_transfert_data *transfer
 {
     gchar *key;
 
-    if ( transfert -> account_number == 0 )
-        key = g_strconcat ("0:", utils_str_itoa ( transfert -> number ), NULL );
-    else
-        key = g_strconcat ( utils_str_itoa ( transfert -> account_number ), ":",
-                        utils_str_itoa ( transfert -> number ), NULL );
+    key = bet_data_get_key ( transfert -> account_number, transfert -> number );
 
     if ( transfert -> number >  transfert_number )
         transfert_number = transfert -> number;
@@ -1741,11 +1682,7 @@ gboolean bet_data_transfert_modify_line ( struct_transfert_data *transfert )
 {
     gchar *key;
 
-    if ( transfert -> account_number == 0 )
-        key = g_strconcat ("0:", utils_str_itoa ( transfert -> number ), NULL );
-    else
-        key = g_strconcat ( utils_str_itoa ( transfert -> account_number ), ":",
-                        utils_str_itoa ( transfert -> number ), NULL );
+    key = bet_data_get_key ( transfert -> account_number, transfert -> number );
 
     g_hash_table_replace ( bet_transfert_list, key, transfert );
 
@@ -1867,6 +1804,35 @@ gboolean bet_data_remove_all_bet_data ( gint account_number )
 }
 
 
+/**
+ * retourne la clef de recherche de la division passée en paramètre.
+ *
+ *
+ *
+ * */
+gchar *bet_data_get_key ( gint account_number, gint div_number )
+{
+    gchar *key;
+    gchar *div_number_str, *account_number_str; /* only to avoid memory leaks */
+
+    div_number_str = utils_str_itoa ( div_number );
+
+    if ( account_number == 0 )
+        key = g_strconcat ("0:", div_number_str, NULL );
+    else
+    {
+        account_number_str = utils_str_itoa ( account_number );
+        key = g_strconcat ( account_number_str, ":", div_number_str, NULL );
+
+        g_free ( account_number_str );
+    }
+
+    g_free ( div_number_str );
+
+    return key;
+}
+
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/gsb_assistant_account.c b/src/gsb_assistant_account.c
index 84f1caf..83eb348 100644
--- a/src/gsb_assistant_account.c
+++ b/src/gsb_assistant_account.c
@@ -498,6 +498,7 @@ void gsb_assistant_account_change_account_icon ( GtkWidget *button, gpointer dat
     {
         devel_debug ( error -> message );
         dialogue_error ( error -> message );
+        g_error_free ( error );
     }
     else
     {
diff --git a/src/gsb_file_config.c b/src/gsb_file_config.c
index 851552c..6dcfb94 100644
--- a/src/gsb_file_config.c
+++ b/src/gsb_file_config.c
@@ -1540,7 +1540,10 @@ gchar *gsb_config_get_old_conf_name ( void )
         }
     }
     else
+    {
         dialogue_error ( error -> message );
+        g_error_free ( error );
+    }
 
     if ( g_slist_length ( liste ) == 0 )
         return NULL;
diff --git a/src/gsb_file_load.c b/src/gsb_file_load.c
index f5be275..4c78fb8 100644
--- a/src/gsb_file_load.c
+++ b/src/gsb_file_load.c
@@ -9027,7 +9027,10 @@ void gsb_file_load_copy_old_file ( gchar *filename, gchar *file_content)
         file_copy = g_file_new_for_path ( copy_old_filename );
         if ( !g_file_copy ( file_ori, file_copy, G_FILE_COPY_OVERWRITE, 
                         NULL, NULL, NULL, &error ) )
+        {
             dialogue_error (error -> message );
+            g_error_free ( error );
+        }
     }
 }
 /* Local Variables: */
diff --git a/src/gsb_select_icon.c b/src/gsb_select_icon.c
index bbbf6d9..7a75142 100644
--- a/src/gsb_select_icon.c
+++ b/src/gsb_select_icon.c
@@ -369,7 +369,10 @@ GtkTreePath * gsb_select_icon_fill_icon_view (  gchar * name_icon )
         g_dir_close ( dir );
     }
     else
+    {
         dialogue_error ( error -> message );
+        g_error_free ( error );
+    }
 
     if ( tree_path == NULL )
         tree_path = gtk_tree_path_new_from_string ( "0" );
@@ -657,7 +660,10 @@ GdkPixbuf *gsb_select_icon_get_default_logo_pixbuf ( void )
                         (GRISBI_PIXMAPS_DIR, "grisbi-logo.png", NULL), &error );
 
     if ( ! pixbuf )
+    {
         devel_debug ( error -> message );
+        g_error_free ( error );
+    }
 
     if ( gdk_pixbuf_get_width (pixbuf) > LOGO_WIDTH ||
 	     gdk_pixbuf_get_height (pixbuf) > LOGO_HEIGHT )
@@ -890,6 +896,7 @@ gboolean gsb_select_icon_new_account_icon_from_file ( gint account_number,
                         filename, NULL );
         devel_debug ( tmp_str );
         dialogue_error ( tmp_str );
+        g_error_free ( error );
         g_free ( tmp_str );
         g_free ( icon );
 
@@ -909,13 +916,12 @@ GdkPixbuf *gsb_select_icon_change_account_pixbuf ( gint account_number,
 {
     GSList *list_tmp;
     GdkPixbuf *pixbuf;
-    GError *error = NULL;
 
     if ( icon_buffer
 	 &&
 	 icon_buffer -> account_number == account_number )
     {
-        pixbuf = gdk_pixbuf_new_from_file_at_size ( filename , 32, 32, &error );
+        pixbuf = gdk_pixbuf_new_from_file_at_size ( filename , 32, 32, NULL );
         if ( pixbuf )
         {
             g_object_unref ( icon_buffer -> pixbuf );
@@ -937,7 +943,7 @@ GdkPixbuf *gsb_select_icon_change_account_pixbuf ( gint account_number,
 
         if ( icon -> account_number == account_number )
         {
-            pixbuf = gdk_pixbuf_new_from_file_at_size ( filename , 32, 32, &error );
+            pixbuf = gdk_pixbuf_new_from_file_at_size ( filename , 32, 32, NULL );
             if ( pixbuf )
             {
                 g_object_unref ( icon -> pixbuf );
diff --git a/src/import.c b/src/import.c
index 1d5ceeb..5543aa1 100644
--- a/src/import.c
+++ b/src/import.c
@@ -534,6 +534,7 @@ gboolean import_switch_type ( GtkCellRendererText *cell, const gchar *path,
         if ( ! g_file_get_contents ( nom_fichier, &tmp_str, NULL, &error ) )
         {
             g_print ( _("Unable to read file: %s\n"), error -> message);
+            g_error_free ( error );
             return FALSE;
         }
 
@@ -688,6 +689,7 @@ gboolean import_select_file ( GtkWidget * button, GtkWidget * assistant )
     if ( ! g_file_get_contents ( iterator -> data, &tmp_str, NULL, &error ) )
     {
         g_print ( _("Unable to read file: %s\n"), error -> message);
+        g_error_free ( error );
         return FALSE;
     }
 
@@ -4386,6 +4388,7 @@ gboolean gsb_import_by_rule ( gint rule )
             if ( ! g_file_get_contents ( filename, &pointeur_char, NULL, &error ) )
             {
                 g_print ( _("Unable to read file: %s\n"), error -> message);
+                g_error_free ( error );
                 i++;
                 continue;
             }
@@ -4677,6 +4680,7 @@ gboolean gsb_import_set_tmp_file ( gchar *filename,
     {
         g_free (contenu_fichier);
         g_print ( _("Unable to create tmp file: %s\n"), error -> message);
+        g_error_free ( error );
         return FALSE;
     }
 
@@ -4710,7 +4714,6 @@ gboolean gsb_import_gunzip_file ( gchar *filename )
             dialogue_error ( tmpstr );
             g_free ( file_content);
             g_error_free (error);
-
             return FALSE;
         }
         else
diff --git a/src/import_csv.c b/src/import_csv.c
index 88b1462..4b1707f 100644
--- a/src/import_csv.c
+++ b/src/import_csv.c
@@ -1081,6 +1081,7 @@ gboolean import_enter_csv_preview_page ( GtkWidget * assistant )
     if ( ! g_file_get_contents ( filename, &tmp_str, &size, &error ) )
     {
         g_print ( _("Unable to read file: %s\n"), error -> message);
+        g_error_free ( error );
         return FALSE;
     }
 
@@ -1091,6 +1092,7 @@ gboolean import_enter_csv_preview_page ( GtkWidget * assistant )
 
     if ( contents == NULL )
     {
+        g_error_free ( error );
         error = NULL;
         size = 0;
         size = 0;  L;  error );  ort_enter_csv_preview_page ( GtkWidget * assistant )  ant )    dat  r  âÇ*          0Éwÿ         "‘ÚàÇ*          òÛàÇ*  °Ówÿ          Ôwÿ  ó˜ÚàÇ*  ÈÜàÇ*  è¤ûàÇ*                          ’ˆ÷áÇ*   Ôwÿ  € âÇ*          0Éwÿ          Èwÿ  ë­ÚàÇ*  6                    è     è!     è!     °Ówÿ   Ôwÿ  xD÷áÇ*          0Êwÿ          "‘ÚàÇ*          ®ÚàÇ*  °Ówÿ  ðÚàÇ*  ïÓwÿ         À?[âÇ*  ó˜ÚàÇ*   0[âÇ*  Ø4[âÇ*  ¨9[âÇ*  ÈÜàÇ*          xD÷áÇ*          0Êwÿ           Éwÿ  ë­ÚàÇ*  à!     à!     °Ówÿ   Ôwÿ  È
×áÇ*          Ëwÿ         "‘ÚàÇ*          ®ÚàÇ*  °Ówÿ  ðÚàÇ*  ïÓwÿ  àÓwÿ  ØÓwÿ  «ûàÇ*  Œp˜         Ôwÿ  ó˜ÚàÇ*  ÈÜàÇ*                  Ëwÿ         àÉwÿ  ë­ÚàÇ*          G       H   I       J   K           M   N   O       P   °Ówÿ   Ôwÿ  HÅ­áÇ*          °Ìwÿ         "‘ÚàÇ*          ®ÚàÇ*  °Ówÿ         0?[âÇ*  ó˜ÚàÇ*   P÷áÇ*   ùŠáÇ*   0[âÇ*  Ø4[âÇ*  ¨9[âÇ*  ÈÜàÇ*          HÅ­áÇ*          °Ìwÿ         ðÊwÿ  ë­ÚàÇ*  8Å­áÇ*          °Ìwÿ          Ëwÿ  ë­ÚàÇ*  (Å­áÇ*          °Ìwÿ         PËwÿ  ë­ÚàÇ*  Å­áÇ*          °Ìwÿ         €Ëwÿ  ë­ÚàÇ*  	       ¨>[âÇ*  ó˜ÚàÇ*         ¨9[âÇ*   Æwÿ          ŠH‹áÇ*  æ—ÚàÇ*         Ø4[âÇ*   Ìwÿ          yH‹áÇ*  æ—ÚàÇ*          0[âÇ*  PÌwÿ          ZH‹áÇ*  æ—ÚàÇ*  ØôŠáÇ*   P÷áÇ*   ùŠáÇ*   0[âÇ*  ØT÷áÇ*  Ø4[âÇ*  ¨9[âÇ*  ÈÜàÇ*          à=‰áÇ*          ÐÍwÿ          Ìwÿ  ë­ÚàÇ*  #   %       '       )       *   -   .   0   3       5   6   7   8   :   <   =   °Ówÿ   Ôwÿ  
 p{UáÇ*          ðÎwÿ          "‘ÚàÇ*                 8_÷áÇ*  ó˜ÚàÇ*  ØT÷áÇ*   Y÷áÇ*  ÈÜàÇ*                          c   f   ½!áÇ*   Ôwÿ  p{UáÇ*          ðÎwÿ          ÀÍwÿ  ë­ÚàÇ*  Ó%°•æ§ìš‹wqÒ-øÒ êÓïs¨Ó,~9„×u]ÞÓ	4Q ÷U^Qʉ§ ¶uª¹ñìò*ēv´R'áÇ*          `Õwÿ  F`¾âÇ*  F`¾âÇ*         ?¥$áÇ*          Õwÿ  €Ìwÿ  @Ðwÿ  ½!áÇ*  æ—ÚàÇ*  è¤ûàÇ*   Öwÿ  B`¾âÇ*  pÕwÿ  ïÓwÿ  õ<üàÇ*   Ôwÿ          ÿÿÿÿÿÿÿÿB`¾âÇ*          (Ôwÿ  ë­Úà                 bytes_written = 0;
@@ -1105,6 +1107,7 @@ gboolean import_enter_csv_preview_page ( GtkWidget * assistant )
         if ( bytes_written == 0 )
         {
             g_print ( _("Unable to read file: %s\n"), error -> message);
+            g_error_free ( error );
             return FALSE;
         }
     }
diff --git a/src/utils.c b/src/utils.c
index 16361ef..aeb64ef 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -555,6 +555,7 @@ void lance_mailer ( const gchar *uri )
         tmp_str = g_strdup_printf ( _("Grisbi was unable to execute a mailer to write at <tt>%s</tt>.\n"
                     "The error was: %s."),
                     uri, error -> message );
+        g_error_free ( error );
         dialogue_error_hint ( tmp_str, _("Cannot execute mailer") );
         g_free(tmp_str);
     }
diff --git a/src/utils_dates.c b/src/utils_dates.c
index 4f45bb2..c84118e 100644
--- a/src/utils_dates.c
+++ b/src/utils_dates.c
@@ -79,6 +79,7 @@ gchar *gsb_date_today ( void )
         date = gdate_today ( );
         date_string = gsb_format_gdate ( date );
         gsb_date_set_last_date ( date_string );
+        g_free ( date_string );
         g_date_free ( date );
     }
     return (last_date);
@@ -678,8 +679,10 @@ gchar *gsb_date_get_compiled_time ( void )
 
     date = g_date_new_dmy ( atoi ( tab[1] ), mois, atoi ( tab[2] ) );
     g_strfreev (tab);
+    str = gsb_format_gdate ( date );
+    g_date_free ( date );
 
-    return gsb_format_gdate ( date );
+    return str;
 }
 
 
diff --git a/src/utils_editables.c b/src/utils_editables.c
index ecfd082..6b15472 100644
--- a/src/utils_editables.c
+++ b/src/utils_editables.c
@@ -155,7 +155,10 @@ gsb_real gsb_utils_edit_calculate_entry ( GtkWidget *entry )
     if ( string && strlen ( string ) )
         pointeur = string + strlen ( string );
     else
+    {
+        g_free ( string );
         return total;
+    }
 
     if ( g_utf8_strchr ( string, -1, '-' ) || g_utf8_strchr ( string, -1, '+' ) )
     {
diff --git a/src/utils_files.c b/src/utils_files.c
index d86629a..032db50 100644
--- a/src/utils_files.c
+++ b/src/utils_files.c
@@ -534,7 +534,6 @@ GSList *utils_files_check_UTF8_validity ( const gchar *contents,
     gint long_str = 0;
     gsize size = 0;
     gsize bytes_written = 0;
-    GError * error = NULL;
     gint i = 0;
     gchar *ptr;
 
@@ -565,7 +564,7 @@ GSList *utils_files_check_UTF8_validity ( const gchar *contents,
                 do
                 {
                      tmp_str = g_convert ( string, long_str, "UTF-8", charset_array[i],
-                                &size, &bytes_written, &error );
+                                &size, &bytes_written, NULL );
                     if ( tmp_str )
                     {
                         result = g_malloc0 ( sizeof ( struct struc_check_encoding ) );
diff --git a/src/utils_str.c b/src/utils_str.c
index 8c1e881..729a8a8 100644
--- a/src/utils_str.c
+++ b/src/utils_str.c
@@ -892,12 +892,16 @@ gchar *utils_str_dtostr ( gdouble number, gint nbre_decimal, gboolean canonical
 {
     gchar buffer[G_ASCII_DTOSTR_BUF_SIZE];
     gchar *str_number;
+    gchar *decimal;
     gchar *format;
     gint nbre_char;
 
-    format = g_strconcat ( "%.", utils_str_itoa ( nbre_decimal ), "f", NULL );
-
+    decimal = utils_str_itoa ( nbre_decimal );
+    format = g_strconcat ( "%.", decimal, "f", NULL );
     nbre_char = g_sprintf ( buffer, format, number );
+    g_free ( decimal );
+    g_free ( format );
+
     if ( nbre_char > G_ASCII_DTOSTR_BUF_SIZE )
         return NULL;
 
@@ -1004,7 +1008,10 @@ gchar *utils_str_incremente_number_from_str ( const gchar *str_number, gint incr
     new_str_number = utils_str_itoa ( number );
 
     if ( prefix && strlen ( prefix ) > 0 )
+    {
         new_str_number = g_strconcat ( prefix, new_str_number, NULL );
+        g_free ( prefix );
+    }
 
     return new_str_number;
 }


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list