mirror of https://git.48k.eu/ogserver
#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.master
parent
1c52b78e72
commit
76e6375720
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue