From: Denys Vlasenko Date: Sun, 10 Feb 2013 22:03:38 +0000 (+0100) Subject: vasprintf: return -1 on strdup failure X-Git-Tag: 1_22_0~300 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=272d85cc8554299502d802b3db7317a7381e8bd7;p=oweals%2Fbusybox.git vasprintf: return -1 on strdup failure Signed-off-by: Denys Vlasenko --- diff --git a/libbb/platform.c b/libbb/platform.c index d241d25a7..19734517b 100644 --- a/libbb/platform.c +++ b/libbb/platform.c @@ -33,7 +33,7 @@ int FAST_FUNC vasprintf(char **string_ptr, const char *format, va_list p) if (r < 128) { va_end(p2); *string_ptr = strdup(buf); - return r; + return (*string_ptr ? r : -1); } *string_ptr = malloc(r+1);