mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-06 13:14:21 +01:00
FFlist: add tests
This commit is contained in:
+4
-2
@@ -46,6 +46,8 @@ uint32_t ffListFirstIndexComp(const FFlist* list, void* compElement, bool(*compF
|
||||
|
||||
void ffListDestroy(FFlist* list)
|
||||
{
|
||||
if(list->data != NULL)
|
||||
free(list->data);
|
||||
//Avoid free-after-use. These 3 assignments are cheap so don't remove them
|
||||
list->capacity = list->length = 0;
|
||||
free(list->data);
|
||||
list->data = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user