mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix possible memory leak if report level not set
This commit is contained in:
parent
a70a1d299a
commit
656d6dac15
@ -145,11 +145,12 @@ static void event_handler(void *arg, esp_event_base_t event_base,
|
||||
static void ftm_process_report(void)
|
||||
{
|
||||
int i;
|
||||
char *log = malloc(200);
|
||||
char *log = NULL;
|
||||
|
||||
if (!g_report_lvl)
|
||||
return;
|
||||
|
||||
log = malloc(200);
|
||||
if (!log) {
|
||||
ESP_LOGE(TAG_STA, "Failed to alloc buffer for FTM report");
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user