diff options
author | Darren Tucker <dtucker@zip.com.au> | 2007-09-14 02:04:15 +0200 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2007-09-14 02:04:15 +0200 |
commit | 84287b831ecbe105cea14294c8f5b058546ce801 (patch) | |
tree | 5ab544c7af4f5255c4f465b37a2099c646d58983 /openbsd-compat/bsd-asprintf.c | |
parent | - (tim) [configure.ac] Autoconf didn't define HAVE_LIBIAF because we (diff) | |
download | openssh-84287b831ecbe105cea14294c8f5b058546ce801.tar.xz openssh-84287b831ecbe105cea14294c8f5b058546ce801.zip |
- (dtucker) [openbsd-compat/bsd-asprintf.c] Plug mem leak in error path.
Patch from Jan.Pechanec at sun com.
Diffstat (limited to 'openbsd-compat/bsd-asprintf.c')
-rw-r--r-- | openbsd-compat/bsd-asprintf.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/openbsd-compat/bsd-asprintf.c b/openbsd-compat/bsd-asprintf.c index 00fa0dfd8..3368195d4 100644 --- a/openbsd-compat/bsd-asprintf.c +++ b/openbsd-compat/bsd-asprintf.c @@ -55,6 +55,7 @@ vasprintf(char **str, const char *fmt, va_list ap) if (ret >= 0 && ret < INIT_SZ) { /* succeeded with initial alloc */ *str = string; } else if (ret == INT_MAX || ret < 0) { /* Bad length */ + free(string); goto fail; } else { /* bigger than initial, realloc allowing for nul */ len = (size_t)ret + 1; |