diff options
author | TingPing <tingping@tingping.se> | 2014-12-11 12:13:57 -0500 |
---|---|---|
committer | TingPing <tingping@tingping.se> | 2014-12-11 12:13:57 -0500 |
commit | d6e3f740bc93e6bf472d165f5a7c5e8b69be1a8b (patch) | |
tree | d8a94487bab1de2ff9a5269d1ae021667d1c212f /src/common/text.c | |
parent | 72f82d096c05dc97b26f9ca30093343161dc4444 (diff) |
Fix some leaks
Diffstat (limited to 'src/common/text.c')
-rw-r--r-- | src/common/text.c | 5 |
1 files changed, 5 insertions, 0 deletions
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; } |