Skip to content

Commit a1bd23d

Browse files
committed
mfu: avoid free elem_t->ref w/o detail
The elem_t->ref attribute is assigned only when the element is initialized with detail. Skip mfu_free() when the structure is initializd without detail. Signed-off-by: Rémi Palancher <[email protected]>
1 parent 530594f commit a1bd23d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/common/mfu_flist.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,8 @@ static void list_delete(flist_t* flist)
404404
while (current != NULL) {
405405
elem_t* next = current->next;
406406
mfu_free(&current->file);
407-
mfu_free(&current->ref);
407+
if (current->detail)
408+
mfu_free(&current->ref);
408409
mfu_free(&current);
409410
current = next;
410411
}

0 commit comments

Comments
 (0)