fixed why2_realloc memory leak

so basically - this function was running realloc SO free() was used... I need why2_free() :D

fixed that fucking leak yay
This commit is contained in:
Václav Šmejkal 2023-02-02 15:50:43 +01:00
parent c9c65badad
commit 9bfa7453ec
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -109,7 +109,9 @@ void *why2_calloc(unsigned long element, unsigned long size)
void *why2_realloc(void *pointer, unsigned long size)
{
void *allocated = realloc(pointer, size);
if (pointer != NULL) why2_free(pointer);
void *allocated = malloc(size);
push_to_list(allocated);