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 <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
YiHungWei authored and blp committed Nov 2, 2017
1 parent d2cb021 commit 36e6714
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ofproto/ofproto-dpif-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 36e6714

Please sign in to comment.