commit | 272d85cc8554299502d802b3db7317a7381e8bd7 | [log] [tgz] |
---|---|---|
author | Denys Vlasenko <vda.linux@googlemail.com> | Sun Feb 10 23:03:38 2013 +0100 |
committer | Denys Vlasenko <vda.linux@googlemail.com> | Sun Feb 10 23:03:38 2013 +0100 |
tree | fea115a521dc0a09606401e2a4e3cb1eb29c703f | |
parent | b5fc51198bf451885e6411bae9b25890a5b6fbe2 [diff] |
vasprintf: return -1 on strdup failure Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
diff --git a/libbb/platform.c b/libbb/platform.c index d241d25..1973451 100644 --- a/libbb/platform.c +++ b/libbb/platform.c
@@ -33,7 +33,7 @@ if (r < 128) { va_end(p2); *string_ptr = strdup(buf); - return r; + return (*string_ptr ? r : -1); } *string_ptr = malloc(r+1);