ofproto/trace: Fix memory leak in oftrace_push_ct_state()
Free the allocated memory in the pop function.
Fixes: ("ofproto/trace: Add --ct-next option to ofproto/trace")
@@ -135,7 +135,9 @@ oftrace_pop_ct_state(struct ovs_list *next_ct_states)
{
struct oftrace_next_ct_state *s;
LIST_FOR_EACH_POP (s, node, next_ct_states) {
- return s->state;
+ uint32_t state = s->state;
+ free(s);
+ return state;
}
OVS_NOT_REACHED();
}
