diff options
author | Jose M. Guisado <jguisado@soleta.eu> | 2021-02-24 14:19:32 +0100 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2021-02-24 14:33:22 +0100 |
commit | 76e6375720d12a7784e4784bb08b2e0050bdcf45 (patch) | |
tree | c4756786b0f177f41e5d4e71f35e612156a94a70 /src | |
parent | 1c52b78e72dade90f23cf9d41e7700648a10eee6 (diff) |
#1004 Fix memleak in og_cmd_images
image_json object is created to store the json representation of
an image returned by the database. This object is going to be appended
to a json list that will compose the overall root json object.
Use json_array_append_new to let "images" steal the reference of
image_json so when further decref(root) there is no json reference
hanging around.
Diffstat (limited to 'src')
-rw-r--r-- | src/rest.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1890,7 +1890,7 @@ static int og_cmd_images(char *buffer_reply) return -1; } - json_array_append(images, image_json); + json_array_append_new(images, image_json); } dbi_result_free(result); |