Fix resource leak in case of malformed cloud request (#9934)

This commit is contained in:
Timotej S 2020-09-16 09:59:46 +02:00 committed by GitHub
parent 8f6f1baf9a
commit a1b997f7bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -104,8 +104,11 @@ static int aclk_handle_cloud_request_v2(struct aclk_request *cloud_to_agent, cha
return 1;
}
if (unlikely(aclk_v2_payload_get_query(data, cloud_to_agent)))
if (unlikely(aclk_v2_payload_get_query(data, cloud_to_agent))) {
error("Could not extract payload from query");
freez(data);
return 1;
}
if (unlikely(!cloud_to_agent->callback_topic)) {
error("Missing callback_topic");