]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
In json output, if the commands add zero length string, it occur allocation fail...
authorbeomsooo.kim <beomsooo.kim@samsung.com>
Thu, 22 Nov 2018 04:08:42 +0000 (13:08 +0900)
committerbeomsooo.kim <beomsooo.kim@samsung.com>
Thu, 22 Nov 2018 04:08:42 +0000 (13:08 +0900)
json.c

diff --git a/json.c b/json.c
index d2f9fb73f95afd3d200a860266ffd91c1051acd4..ee400356679323c316467c89b54179860b5a2618 100644 (file)
--- 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)