Skip to content

Commit

Permalink
ofproto/trace: Fix memory leak in oftrace_push_ct_state()
Browse files Browse the repository at this point in the history
Free the allocated memory in the pop function.

Fixes: 0f2f05b ("ofproto/trace: Add --ct-next option to ofproto/trace")
Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
YiHungWei authored and blp committed Nov 2, 2017
1 parent 9e08db9 commit e183031
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ofproto/ofproto-dpif-trace.c
Expand Up @@ -133,7 +133,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();
}
Expand Down

0 comments on commit e183031

Please sign in to comment.