Fix resource leak in case of malformed cloud request (#9934)
Fix resource leak in case of malformed cloud request (#9934)
Timotej S committed
Sep 16, 2020 at 09:59 UTC
a1b997f7bcc5dc8de93473abc27d413035c2d47e
1 file changed
+4
-1
aclk/aclk_rx_msgs.c
+4
-1
@@ -104,8 +104,11 @@ static int aclk_handle_cloud_request_v2(struct aclk_request *cloud_to_agent, cha
104
return 1;
105
}
106
107
- if (unlikely(aclk_v2_payload_get_query(data, cloud_to_agent)))
107
+ if (unlikely(aclk_v2_payload_get_query(data, cloud_to_agent))) {
108
+ error("Could not extract payload from query");
109
+ freez(data);
110
return 1;
111
+ }
112
113
if (unlikely(!cloud_to_agent->callback_topic)) {
114
error("Missing callback_topic");