mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 16:54:30 +00:00
lib: Fix memory leak in matcher
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
ee761cc086
commit
67c02c9449
@ -94,7 +94,7 @@ command_match (struct graph *cmdgraph,
|
|||||||
|
|
||||||
// prepend a dummy token to match that pesky start node
|
// prepend a dummy token to match that pesky start node
|
||||||
vector vvline = vector_init (vline->alloced + 1);
|
vector vvline = vector_init (vline->alloced + 1);
|
||||||
vector_set_index (vvline, 0, (void *) "dummy");
|
vector_set_index (vvline, 0, (void *) XSTRDUP (MTYPE_TMP, "dummy"));
|
||||||
memcpy (vvline->index + 1, vline->index, sizeof (void *) * vline->alloced);
|
memcpy (vvline->index + 1, vline->index, sizeof (void *) * vline->alloced);
|
||||||
vvline->active = vline->active + 1;
|
vvline->active = vline->active + 1;
|
||||||
|
|
||||||
@ -114,6 +114,11 @@ command_match (struct graph *cmdgraph,
|
|||||||
assert (*el);
|
assert (*el);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// free the leader token we alloc'd
|
||||||
|
XFREE (MTYPE_TMP, vector_slot (vvline, 0));
|
||||||
|
// free vector
|
||||||
|
vector_free (vvline);
|
||||||
|
|
||||||
return matcher_rv;
|
return matcher_rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user