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:
@ -187,6 +187,8 @@ bool do_auth(MHD_Connection *connection, const char* url)
|
||||
MXS_INFO("Accept authentication from '%s', %s. Request: %s", user ? user : "",
|
||||
pw ? "using password" : "no password", url);
|
||||
}
|
||||
MXS_FREE(user);
|
||||
MXS_FREE(pw);
|
||||
}
|
||||
|
||||
return rval;
|
||||
|
||||
Reference in New Issue
Block a user