state: plug memory leak when upserting
This commit is contained in:
parent
8e4eb5d00c
commit
865bf7cac6
1 changed files with 2 additions and 0 deletions
|
@ -66,6 +66,8 @@ lif_state_read_path(struct lif_dict *state, const char *path)
|
|||
void
|
||||
lif_state_upsert(struct lif_dict *state, const char *ifname, struct lif_interface *iface)
|
||||
{
|
||||
lif_state_delete(state, ifname);
|
||||
|
||||
struct lif_state_record *rec = calloc(1, sizeof(*rec));
|
||||
|
||||
rec->mapped_if = strdup(iface->ifname);
|
||||
|
|
Loading…
Reference in a new issue