espressif / esp-usb

Other
15 stars 9 forks source link

Fix memory leak of the bvalid_sig test #23

Closed peter-marcisovsky closed 3 months ago

peter-marcisovsky commented 3 months ago

Even though the test_bvalid_sig is not running in CI yet, I discovered this issue when refactoring the test app. The test was failing due to memory leak.

The problem was, that the tusb task was still running, after the test was finished.

Before:

MALLOC_CAP_8BIT: Before 385196 bytes free, After 380676 bytes free (delta -4520)
./main/test_bvalid_sig.c:20:bvalid_signal:FAIL:Function [esp_tinyusb][usb_device].  memory leak

Fixed:

MALLOC_CAP_8BIT: Before 385196 bytes free, After 385144 bytes free (delta -52)
MALLOC_CAP_32BIT: Before 385196 bytes free, After 385144 bytes free (delta -52)