From 2e9212d966688e184575e2cd59fbd6403db256b2 Mon Sep 17 00:00:00 2001 From: "Tim J. Robbins" Date: Fri, 11 Oct 2002 23:31:50 +0000 Subject: [PATCH] Save errno around calls to free(); at least some code paths clobber it and we are not interested in any errors it may report. --- lib/libc/stdlib/strfmon.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c index 6b127fd99beb..6392e74034cd 100644 --- a/lib/libc/stdlib/strfmon.c +++ b/lib/libc/stdlib/strfmon.c @@ -114,6 +114,7 @@ strfmon(char * __restrict s, size_t maxsize, const char * __restrict format, char *tmpptr; /* temporary vars */ int *ntmp; + int sverrno; va_start(ap, format); @@ -377,10 +378,12 @@ format_error: errno = EINVAL; end_error: + sverrno = errno; if (asciivalue != NULL) free(asciivalue); if (currency_symbol != NULL) free(currency_symbol); + errno = sverrno; va_end(ap); return (-1); }