Changeset 25025

Show
Ignore:
Timestamp:
02/08/10 21:18:43 (7 months ago)
Author:
piotras
Message:

Free unused values. Fix memory leaks.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midgard/core/midgard/src/midgard_core_query.c

    r25017 r25025  
    500500                        g_value_transform ((const GValue *) value, tval); 
    501501                        *values = g_slist_prepend (*values, (gpointer) tval); 
     502                        g_value_unset (value); 
     503                        g_free (value); 
    502504 
    503505                } else { 
     
    524526 
    525527        for (slist = values; slist != NULL; slist = slist->next) { 
    526                 g_value_unset ((GValue *) slist->data); 
    527                 g_free ((GValue *) slist->data); 
     528                GValue *val = (GValue *) slist->data; 
     529                if (!G_VALUE_HOLDS_OBJECT (val)) 
     530                        g_value_unset (val); 
     531                g_free (val); 
    528532        } 
    529533} 
     
    700704         
    701705        __unset_values_list (values); 
    702         g_slist_free (names); 
     706        g_slist_free (names);   
    703707        g_slist_free (values); 
    704708 
     
    12211225                i++; 
    12221226        } 
    1223          
     1227 
    12241228        g_string_append_printf (sql, " WHERE %s.guid = '%s'", table, guid); 
    12251229 
     
    12711275 
    12721276        gchar *debug_sql = gda_connection_statement_to_sql (cnc, stmt, params, GDA_STATEMENT_SQL_PRETTY, NULL, NULL); 
    1273         g_debug ("%s", debug_sql); 
    12741277        g_free (debug_sql); 
    12751278