We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 34a46de commit c7807cfCopy full SHA for c7807cf
ports/espressif/common-hal/audiomp3/__init__.c
@@ -25,18 +25,20 @@
25
*/
26
27
#include <stdlib.h>
28
+#include <string.h>
29
#include "py/mpprint.h"
30
#include "esp_heap_caps.h"
31
#include "shared-module/audiomp3/__init__.h"
32
#include "supervisor/port_heap.h"
33
34
void *mp3_alloc(size_t sz) {
35
void *ptr = heap_caps_malloc(sz, MALLOC_CAP_8BIT);
- mp_printf(&mp_plat_print, "alloc(%d) -> %ptr\n", (int)sz, ptr);
36
+ if (ptr) {
37
+ memset(ptr, 0, sz);
38
+ }
39
return ptr;
40
}
41
42
void mp3_free(void *ptr) {
- mp_printf(&mp_plat_print, "free(%p)\n", ptr);
43
heap_caps_free(ptr);
44
0 commit comments