Explorar o código

fix memory leak in sd_erase in bsp/simulator

prife %!s(int64=13) %!d(string=hai) anos
pai
achega
821d0ac252
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      bsp/simulator/drivers/sd_sim.c

+ 1 - 0
bsp/simulator/drivers/sd_sim.c

@@ -203,6 +203,7 @@ int sd_erase(void)
     {
         rt_sdcard_write(device, index, buffer, SECTOR_SIZE);
     }
+    rt_free(buffer);
     return 0;
 }
 FINSH_FUNCTION_EXPORT(sd_erase, erase all block in SPI flash);