Fix memory leaks in REST API
The call to MHD_basic_auth_get_username_password allocates memory for both the password and the username. mxs_json_add_relation leaked a reference to a JSON object by using json_array_append instead of json_array_append_new.
This commit is contained in:
@ -59,7 +59,7 @@ void mxs_json_add_relation(json_t* rel, const char* id, const char* type)
|
||||
json_t* obj = json_object();
|
||||
json_object_set_new(obj, CN_ID, json_string(id));
|
||||
json_object_set_new(obj, CN_TYPE, json_string(type));
|
||||
json_array_append(data, obj);
|
||||
json_array_append_new(data, obj);
|
||||
}
|
||||
|
||||
static string grab_next_component(string* s)
|
||||
|
Reference in New Issue
Block a user