From e2fa2d47872d8d3111996e9d3d96b326fd316904 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Wed, 30 Nov 2011 02:18:18 +0100 Subject: [PATCH] fix some memory leaks --- src/common/plugin.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/plugin.c b/src/common/plugin.c index 96510265..7bc39400 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -1698,6 +1698,7 @@ xchat_get_plugin_pref (xchat_plugin *pl, char *var, char *dest) if (!cfg) { + close (fh); return 0; } @@ -1711,6 +1712,8 @@ xchat_get_plugin_pref (xchat_plugin *pl, char *var, char *dest) if (!cfg_get_str (cfg, var, dest, 512)) /* dest_len is the same as buffer size in set */ { + free (cfg); + close (fh); return 0; }