From: beomsooo.kim Date: Thu, 22 Nov 2018 04:08:42 +0000 (+0900) Subject: In json output, if the commands add zero length string, it occur allocation fail... X-Git-Tag: v1.7~24^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=26ac17d062df09b0c511e01aa66a876298632469;p=users%2Fsagi%2Fnvme-cli.git In json output, if the commands add zero length string, it occur allocation fail & abort (cannot display empty value) --- diff --git a/json.c b/json.c index d2f9fb73..ee400356 100644 --- a/json.c +++ b/json.c @@ -123,6 +123,7 @@ static struct json_value *json_create_value_string(const char *str) if (!value->string) { free(value); value = NULL; + return value; } } if (!value)