summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2008-04-19 07:22:58 +0000
committerru <ru@FreeBSD.org>2008-04-19 07:22:58 +0000
commit27e53e835a3b6849a877c135a5dfe6d7b901befe (patch)
treedc89847369cbade0fad425f69ba124ba5289cc01 /lib
parentb15775c48abb36de1b048ed03dd48b4c914c50c9 (diff)
downloadFreeBSD-src-27e53e835a3b6849a877c135a5dfe6d7b901befe.zip
FreeBSD-src-27e53e835a3b6849a877c135a5dfe6d7b901befe.tar.gz
Don't forget to free() currency_symbol and asciivalue when multiple
conversion specifiers for them are present. Submitted by: Maxim Dounin <mdounin@mdounin.ru> Obtained from: NetBSD (partially) MFC after: 3 days
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdlib/strfmon.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c
index abfa332..20c69be 100644
--- a/lib/libc/stdlib/strfmon.c
+++ b/lib/libc/stdlib/strfmon.c
@@ -225,6 +225,8 @@ strfmon(char * __restrict s, size_t maxsize, const char * __restrict format,
goto format_error;
}
+ if (currency_symbol != NULL)
+ free(currency_symbol);
if (flags & USE_INTL_CURRENCY) {
currency_symbol = strdup(lc->int_curr_symbol);
if (currency_symbol != NULL)
@@ -253,6 +255,8 @@ strfmon(char * __restrict s, size_t maxsize, const char * __restrict format,
pad_size = 0;
}
+ if (asciivalue != NULL)
+ free(asciivalue);
asciivalue = __format_grouped_double(value, &flags,
left_prec, right_prec, pad_char);
if (asciivalue == NULL)
OpenPOWER on IntegriCloud