# HG changeset patch # User Sadrul Habib Chowdhury # Date 1182977199 0 # Node ID 8aff2d3d6820dfb22ff16dce6127b7a6ffc655b1 # Parent 70325b0c579271bad57e6fd10dbe985e87c1b2fc Plug a memory leak. diff -r 70325b0c5792 -r 8aff2d3d6820 finch/libgnt/gntstyle.c --- a/finch/libgnt/gntstyle.c Wed Jun 27 20:38:10 2007 +0000 +++ b/finch/libgnt/gntstyle.c Wed Jun 27 20:46:39 2007 +0000 @@ -45,7 +45,7 @@ return str_styles[style]; } -const char *gnt_style_get_from_name(const char *group, const char *key) +char *gnt_style_get_from_name(const char *group, const char *key) { #if GLIB_CHECK_VERSION(2,6,0) return g_key_file_get_value(gkfile, group, key, NULL); diff -r 70325b0c5792 -r 8aff2d3d6820 finch/libgnt/gntstyle.h --- a/finch/libgnt/gntstyle.h Wed Jun 27 20:38:10 2007 +0000 +++ b/finch/libgnt/gntstyle.h Wed Jun 27 20:46:39 2007 +0000 @@ -45,7 +45,7 @@ const char *gnt_style_get(GntStyle style); -const char *gnt_style_get_from_name(const char *group, const char *key); +char *gnt_style_get_from_name(const char *group, const char *key); /** * diff -r 70325b0c5792 -r 8aff2d3d6820 finch/libgnt/wms/irssi.c --- a/finch/libgnt/wms/irssi.c Wed Jun 27 20:38:10 2007 +0000 +++ b/finch/libgnt/wms/irssi.c Wed Jun 27 20:46:39 2007 +0000 @@ -274,7 +274,7 @@ void gntwm_init(GntWM **wm) { - const char *style = NULL; + char *style = NULL; Irssi *irssi; irssi = g_object_new(TYPE_IRSSI, NULL); @@ -282,9 +282,11 @@ style = gnt_style_get_from_name("irssi", "split-v"); irssi->vert = style ? atoi(style) : 1; + g_free(style); style = gnt_style_get_from_name("irssi", "split-h"); irssi->horiz = style ? atoi(style) : 1; + g_free(style); irssi->vert = MAX(irssi->vert, 1); irssi->horiz = MAX(irssi->horiz, 1);