diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2013-02-10 23:03:38 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-02-10 23:03:38 +0100 |
commit | 272d85cc8554299502d802b3db7317a7381e8bd7 (patch) | |
tree | fea115a521dc0a09606401e2a4e3cb1eb29c703f /libbb | |
parent | b5fc51198bf451885e6411bae9b25890a5b6fbe2 (diff) | |
download | busybox-w32-272d85cc8554299502d802b3db7317a7381e8bd7.tar.gz busybox-w32-272d85cc8554299502d802b3db7317a7381e8bd7.tar.bz2 busybox-w32-272d85cc8554299502d802b3db7317a7381e8bd7.zip |
vasprintf: return -1 on strdup failure
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/platform.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
33 | if (r < 128) { | 33 | if (r < 128) { |
34 | va_end(p2); | 34 | va_end(p2); |
35 | *string_ptr = strdup(buf); | 35 | *string_ptr = strdup(buf); |
36 | return r; | 36 | return (*string_ptr ? r : -1); |
37 | } | 37 | } |
38 | 38 | ||
39 | *string_ptr = malloc(r+1); | 39 | *string_ptr = malloc(r+1); |