diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-07-29 06:30:01 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-07-29 06:30:01 +0000 |
commit | 3365355534071fb1c03728787f4ef7459e44593f (patch) | |
tree | cf8e8c9189f2eecb181ccfee8a52a662179c92ba | |
parent | 6e21561be8a3f9a29a438ea945b7be7b933fc159 (diff) |
From Joerg Mayer:
gtk/colors.c: Fix a memleak found by valgrind
(Note that there are similar bugs in other functions that
use the same construct with path!)
svn path=/trunk/; revision=5910
-rw-r--r-- | gtk/colors.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gtk/colors.c b/gtk/colors.c index 8afbe63d94..03e270f1c4 100644 --- a/gtk/colors.c +++ b/gtk/colors.c @@ -1,7 +1,7 @@ /* colors.c * Definitions for color structures and routines * - * $Id: colors.c,v 1.20 2002/05/27 22:00:37 guy Exp $ + * $Id: colors.c,v 1.21 2002/07/29 06:30:01 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -154,7 +154,7 @@ read_filters(void) guint16 fg_r, fg_g, fg_b, bg_r, bg_g, bg_b; GdkColor fg_color, bg_color; color_filter_t *colorf; - const gchar *path; + gchar *path; FILE *f; dfilter_t *temp_dfilter; @@ -166,8 +166,11 @@ read_filters(void) "Could not open filter file\n\"%s\": %s.", path, strerror(errno)); } + g_free((gchar *)path); return FALSE; } + g_free((gchar *)path); + path = NULL; do { if (fgets(buf,sizeof buf, f) == NULL) |