Mercurial > pidgin
changeset 18317:8aff2d3d6820
Plug a memory leak.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Wed, 27 Jun 2007 20:46:39 +0000 |
parents | 70325b0c5792 |
children | 477a6ddd56a0 |
files | finch/libgnt/gntstyle.c finch/libgnt/gntstyle.h finch/libgnt/wms/irssi.c |
diffstat | 3 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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);
--- 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); /** *
--- 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);