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:
Markus Mäkelä
2017-08-04 14:51:46 +03:00
parent db531fb2e2
commit cb066fd09a
2 changed files with 3 additions and 1 deletions

View File

@ -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;