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);