Skip to content

Commit

Permalink
Fix memory leak.
Browse files Browse the repository at this point in the history
  • Loading branch information
OtherCrashOverride committed Jul 6, 2018
1 parent 48b9746 commit c09abe2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void app_main(void)
// ensure null terminated
FirmwareDescription[FIRMWARE_DESCRIPTION_SIZE - 1] = 0;

printf("FirmwareDescription='%s", FirmwareDescription);
printf("FirmwareDescription='%s'\n", FirmwareDescription);

// Copy the firmware
bool errorFlag = false;
Expand Down Expand Up @@ -137,7 +137,6 @@ void app_main(void)
// turn LED on
gpio_set_level(GPIO_NUM_2, 1);


// flash
ret = esp_partition_write(part, 0, data, length);
if (ret != ESP_OK)
Expand All @@ -148,6 +147,10 @@ void app_main(void)
}

// TODO: verify

free(data);

printf("Complete: slot=%d, length=%d\n", slot, length);
}

if (!errorFlag)
Expand Down

0 comments on commit c09abe2

Please sign in to comment.