From d6e3f740bc93e6bf472d165f5a7c5e8b69be1a8b Mon Sep 17 00:00:00 2001 From: TingPing Date: Thu, 11 Dec 2014 12:13:57 -0500 Subject: [PATCH] Fix some leaks --- src/common/plugin.c | 2 ++ src/common/text.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/common/plugin.c b/src/common/plugin.c index f386346e..fbef743a 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -1778,6 +1778,8 @@ hexchat_pluginpref_set_str_real (hexchat_plugin *pl, const char *var, const char { g_free (confname); g_free (confname_tmp); + if (fpIn) + fclose (fpIn); return 0; } else if (fpIn == NULL) /* no previous config file, no parsing */ diff --git a/src/common/text.c b/src/common/text.c index 90e400e2..b789371f 100644 --- a/src/common/text.c +++ b/src/common/text.c @@ -1975,9 +1975,11 @@ pevt_build_string (const char *input, char **output, int *max_arg) a_len_error: fe_message ("String ends in $a", FE_MSG_WARN); + free (i); return 1; a_range_error: fe_message ("$a value is greater than 255", FE_MSG_WARN); + free (i); return 1; } if (d == 't') @@ -2001,6 +2003,7 @@ pevt_build_string (const char *input, char **output, int *max_arg) { snprintf (o, sizeof (o), "Error, invalid argument $%c\n", d); fe_message (o, FE_MSG_WARN); + free (i); return 1; } d -= '0'; @@ -2067,6 +2070,8 @@ pevt_build_string (const char *input, char **output, int *max_arg) *max_arg = max; if (output) *output = obuf; + else + free (obuf); return 0; }