# HG changeset patch # User melunko # Date 1177371800 -3600 # Node ID 1c421f2531d3f5a266159557e106431b45a535a3 # Parent 549c4664701e8f6f8500f6931aa70269a08e898d [svn r596] Fixed memory leak when dealocating GMythChannelInfo. diff -r 549c4664701e -r 1c421f2531d3 gmyth/src/gmyth_common.c --- a/gmyth/src/gmyth_common.c Mon Apr 23 21:08:07 2007 +0100 +++ b/gmyth/src/gmyth_common.c Tue Apr 24 00:43:20 2007 +0100 @@ -95,9 +95,13 @@ { #ifdef GMYTH_USE_DEBUG if ( channel_info != NULL ) { + g_return_if_fail (channel_info->channel_name != NULL); + g_return_if_fail (channel_info->channel_num != NULL); + gmyth_debug("ChannelInfo (Name, Num, ID) = (%s, %s, %d)\n", channel_info->channel_name->str, channel_info->channel_num->str, channel_info->channel_ID); + } #endif } @@ -118,11 +122,11 @@ "End time = %s\n" "Path name = %s\n" "File size = %lld\n", - program_info->title ? program_info->title->str : NULL, - program_info->description ? program_info->description->str : NULL, + program_info->title ? program_info->title->str : "NULL", + program_info->description ? program_info->description->str : "NULL", gmyth_util_time_to_string_from_time_val(program_info->startts), gmyth_util_time_to_string_from_time_val(program_info->endts), - program_info->pathname ? program_info->pathname->str : NULL, + program_info->pathname ? program_info->pathname->str : "NULL", program_info->filesize ); #endif } @@ -131,7 +135,7 @@ free_channel_data (gpointer data, gpointer user_data) { /* Frees the GMythChannelInfo structure */ - GMythChannelInfo *channel = (GMythChannelInfo*) user_data; + GMythChannelInfo *channel = (GMythChannelInfo*) data; gmyth_channel_info_free (channel); } diff -r 549c4664701e -r 1c421f2531d3 gmyth/src/gmyth_epg.c --- a/gmyth/src/gmyth_epg.c Mon Apr 23 21:08:07 2007 +0100 +++ b/gmyth/src/gmyth_epg.c Tue Apr 24 00:43:20 2007 +0100 @@ -168,15 +168,15 @@ if (msql_res == NULL) { gmyth_debug ("[%s] msql query returned NULL MYSQL_RES", __FUNCTION__); - return -1; + return -1; } else { MYSQL_ROW row; - GMythChannelInfo *channel_info; + GMythChannelInfo *channel_info; while ((row = mysql_fetch_row (msql_res)) != NULL) { channel_info = g_new0(GMythChannelInfo, 1); - channel_info->channel_ID = g_ascii_strtoull (row[0], NULL, 10); + channel_info->channel_ID = (gint) g_ascii_strtoull (row[0], NULL, 10); channel_info->channel_num = g_string_new (row[1]); channel_info->channel_name = g_string_new (row[2]); channel_info->channel_icon = g_string_new (row[3]);