mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
wifi_prov_mgr : Free memory allocated by cJSON_Print
This commit is contained in:
parent
a13cc7da7a
commit
9f1033862d
@ -296,7 +296,9 @@ static esp_err_t wifi_prov_mgr_start_service(const char *service_name, const cha
|
||||
|
||||
/* Set version information / capabilities of provisioning service and application */
|
||||
cJSON *version_json = wifi_prov_get_info_json();
|
||||
ret = protocomm_set_version(prov_ctx->pc, "proto-ver", cJSON_Print(version_json));
|
||||
char *version_str = cJSON_Print(version_json);
|
||||
ret = protocomm_set_version(prov_ctx->pc, "proto-ver", version_str);
|
||||
free(version_str);
|
||||
cJSON_Delete(version_json);
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGE(TAG, "Failed to set version endpoint");
|
||||
|
Loading…
x
Reference in New Issue
Block a user