diff --git a/libmikmod/include/mikmod_internals.h b/libmikmod/include/mikmod_internals.h index b208b1c8..18267969 100644 --- a/libmikmod/include/mikmod_internals.h +++ b/libmikmod/include/mikmod_internals.h @@ -900,7 +900,7 @@ void MikMod_afree(void *); /* frees if ptr != NULL */ #endif #else /* NO SIMD */ -#define MikMod_amalloc MikMod_malloc +#define MikMod_amalloc(s) MikMod_calloc(1,(s)) #define MikMod_afree MikMod_free #endif diff --git a/libmikmod/playercode/sloader.c b/libmikmod/playercode/sloader.c index 114a9953..4c52ab0f 100644 --- a/libmikmod/playercode/sloader.c +++ b/libmikmod/playercode/sloader.c @@ -388,7 +388,7 @@ SAMPLOAD* SL_RegisterSample(SAMPLE* s,int type,MREADER* reader) return NULL; /* Allocate and add structure to the END of the list */ - if(!(news=(SAMPLOAD*)MikMod_malloc(sizeof(SAMPLOAD)))) return NULL; + if(!(news=(SAMPLOAD*)MikMod_calloc(1, sizeof(SAMPLOAD)))) return NULL; if(cruise) { while(cruise->next) cruise=cruise->next;