Skip to content

Commit 2adfacc

Browse files
author
KristofferC
committed
avoid memory leak in mallocarrays linked list
1 parent 45d3238 commit 2adfacc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/gc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,8 +1255,7 @@ static void sweep_malloced_memory(void) JL_NOTSAFEPOINT
12551255
*pma = nxt;
12561256
int isaligned = (uintptr_t)ma->a & 1;
12571257
jl_gc_free_memory(a, isaligned);
1258-
ma->next = ptls2->heap.mafreelist;
1259-
ptls2->heap.mafreelist = ma;
1258+
free(ma);
12601259
}
12611260
gc_time_count_mallocd_memory(bits);
12621261
ma = nxt;

0 commit comments

Comments
 (0)