diff options
author | tjr <tjr@FreeBSD.org> | 2002-10-11 23:31:50 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-10-11 23:31:50 +0000 |
commit | ce2f2cf1be6d890090b2bd264b49057d5ae5507e (patch) | |
tree | 8cf68f4aec872d0ef997d8ccba35fd441dfe2c95 /lib/libc/stdlib/strfmon.c | |
parent | 0e791b1f7baf2e3d4b67ff98d72759d389d4f967 (diff) | |
download | FreeBSD-src-ce2f2cf1be6d890090b2bd264b49057d5ae5507e.zip FreeBSD-src-ce2f2cf1be6d890090b2bd264b49057d5ae5507e.tar.gz |
Save errno around calls to free(); at least some code paths clobber it
and we are not interested in any errors it may report.
Diffstat (limited to 'lib/libc/stdlib/strfmon.c')
-rw-r--r-- | lib/libc/stdlib/strfmon.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c index 6b127fd..6392e74 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); } |