Free nodes of a lif_dict_find_all() result.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
This commit is contained in:
Maximilian Wilhelm 2020-07-28 23:25:01 +02:00
parent 73f3690432
commit 9d958892ed
3 changed files with 33 additions and 2 deletions

View file

@ -3,6 +3,7 @@
* Purpose: linked lists
*
* Copyright (c) 2020 Ariadne Conill <ariadne@dereferenced.org>
* Copyright (c) 2020 Maximilian Wilhelm <max@sdn.clinic>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -14,8 +15,26 @@
*/
#include <stdint.h>
#include <stdlib.h>
#include "libifupdown/list.h"
void
lif_list_free_nodes(struct lif_list **list)
{
if (*list == NULL)
return;
struct lif_node *iter;
LIF_LIST_FOREACH (iter, (*list)->head)
{
free (iter->prev);
}
free (iter);
free (*list);
}
void
lif_node_insert(struct lif_node *node, void *data, struct lif_list *list)
{