r21233 - gnucash/trunk/src/html - (cppcheck) Fix several memory leaks

Christian Stimming cstim at code.gnucash.org
Thu Sep 1 02:51:19 EDT 2011


Author: cstim
Date: 2011-09-01 02:51:19 -0400 (Thu, 01 Sep 2011)
New Revision: 21233
Trac: http://svn.gnucash.org/trac/changeset/21233

Modified:
   gnucash/trunk/src/html/gnc-html-graph-gog-webkit.c
   gnucash/trunk/src/html/gnc-html-webkit.c
Log:
(cppcheck) Fix several memory leaks

Modified: gnucash/trunk/src/html/gnc-html-graph-gog-webkit.c
===================================================================
--- gnucash/trunk/src/html/gnc-html-graph-gog-webkit.c	2011-09-01 06:51:06 UTC (rev 21232)
+++ gnucash/trunk/src/html/gnc-html-graph-gog-webkit.c	2011-09-01 06:51:19 UTC (rev 21233)
@@ -249,6 +249,7 @@
     if ( temp_str != NULL )
     {
         pieChartInfo.data = read_doubles( temp_str, pieChartInfo.datasize );
+        g_free( temp_str );
     }
     temp_str = get_string_param( &object_info, "colors" );
     if ( temp_str != NULL )
@@ -314,6 +315,7 @@
     if ( temp_str != NULL )
     {
         barChartInfo.data = read_doubles( temp_str, barChartInfo.data_rows * barChartInfo.data_cols );
+        g_free( temp_str );
     }
     barChartInfo.x_axis_label = get_string_param( &object_info, "x_axis_label" );
     barChartInfo.y_axis_label = get_string_param( &object_info, "y_axis_label" );
@@ -394,6 +396,7 @@
     if ( temp_str != NULL )
     {
         lineChartInfo.data = read_doubles( temp_str, lineChartInfo.data_rows * lineChartInfo.data_cols );
+        g_free( temp_str );
     }
     lineChartInfo.x_axis_label = get_string_param( &object_info, "x_axis_label" );
     lineChartInfo.y_axis_label = get_string_param( &object_info, "y_axis_label" );
@@ -465,11 +468,13 @@
     if ( temp_str != NULL )
     {
         scatterPlotInfo.xData = read_doubles( temp_str, scatterPlotInfo.datasize );
+        g_free( temp_str );
     }
     temp_str = get_string_param( &object_info, "y_data" );
     if ( temp_str != NULL )
     {
         scatterPlotInfo.yData = read_doubles( temp_str, scatterPlotInfo.datasize );
+        g_free( temp_str );
     }
 
     pixbuf = gnc_html_graph_gog_create_scatterplot( &scatterPlotInfo );

Modified: gnucash/trunk/src/html/gnc-html-webkit.c
===================================================================
--- gnucash/trunk/src/html/gnc-html-webkit.c	2011-09-01 06:51:06 UTC (rev 21232)
+++ gnucash/trunk/src/html/gnc-html-webkit.c	2011-09-01 06:51:19 UTC (rev 21233)
@@ -377,6 +377,7 @@
     if ( end_object_tag == NULL )
     {
         //  Hmmm... no object end tag
+        g_free (object_classid);
         return html_str;
     }
     end_object_tag += strlen( "</object>" );



More information about the gnucash-changes mailing list