mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-07 03:57:07 +03:00
solve memory leak in monitor & potentially http
This commit is contained in:
@@ -134,8 +134,7 @@ static void monitor_callback(TimerHandle_t xTimer) {
|
|||||||
messaging_post_message(MESSAGING_INFO, MESSAGING_CLASS_STATS,top_a);
|
messaging_post_message(MESSAGING_INFO, MESSAGING_CLASS_STATS,top_a);
|
||||||
FREE_AND_NULL(top_a);
|
FREE_AND_NULL(top_a);
|
||||||
}
|
}
|
||||||
cJSON_free(top);
|
cJSON_Delete(top);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|||||||
@@ -481,7 +481,7 @@ esp_err_t console_cmd_get_handler(httpd_req_t *req){
|
|||||||
ESP_LOGD_LOC(TAG, "Error retrieving command json string. ");
|
ESP_LOGD_LOC(TAG, "Error retrieving command json string. ");
|
||||||
httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR, "Unable to format command");
|
httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR, "Unable to format command");
|
||||||
}
|
}
|
||||||
cJSON_free(cmdlist);
|
cJSON_Delete(cmdlist);
|
||||||
ESP_LOGD_LOC(TAG, "done serving [%s]", req->uri);
|
ESP_LOGD_LOC(TAG, "done serving [%s]", req->uri);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@@ -1139,7 +1139,7 @@ esp_err_t messages_get_handler(httpd_req_t *req){
|
|||||||
CHECK_RESET_FREE_MEM_CHECK(before, "after http send");
|
CHECK_RESET_FREE_MEM_CHECK(before, "after http send");
|
||||||
free(json_text);
|
free(json_text);
|
||||||
CHECK_RESET_FREE_MEM_CHECK(before, "after free json message");
|
CHECK_RESET_FREE_MEM_CHECK(before, "after free json message");
|
||||||
cJSON_free(json_messages);
|
cJSON_Delete(json_messages);
|
||||||
CHECK_RESET_FREE_MEM_CHECK(before, "after free json");
|
CHECK_RESET_FREE_MEM_CHECK(before, "after free json");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user