Skip to content

Commit

Permalink
ovs-ofctl: fix memory leak reported by valgrind.
Browse files Browse the repository at this point in the history
Testcase 1057 ofproto-dpif - fragment handling - upcall reports
the following leak:
  xrealloc (util.c:123)
  vconn_dump_flows (vconn.c:1030)
  read_flows_from_switch (ovs-ofctl.c:3360)
  ofctl_replace_flows (ovs-ofctl.c:3433)
  ovs_cmdl_run_command__ (command-line.c:115)

Signed-off-by: William Tu <[email protected]>
Signed-off-by: Andy Zhou <[email protected]>
  • Loading branch information
williamtu authored and azhou-nicira committed Feb 8, 2017
1 parent d3328b1 commit edb417c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions utilities/ovs-ofctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3375,6 +3375,11 @@ read_flows_from_switch(struct vconn *vconn,

fte_queue(state, &fs->match, fs->priority, version, index);
}

for (size_t i = 0; i < n_fses; i++) {
free(CONST_CAST(struct ofpact *, fses[i].ofpacts));
}
free(fses);
}

static void
Expand Down

0 comments on commit edb417c

Please sign in to comment.