[ovs-dev] [PATCH 2/2] ovs-ofctl: fix memory leak reported by valgrind.

Andy Zhou azhou at ovn.org
Wed Feb 8 07:25:22 UTC 2017


On Tue, Feb 7, 2017 at 10:41 PM, William Tu <u9012063 at gmail.com> wrote:
> 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 <u9012063 at gmail.com>
> ---
>  utilities/ovs-ofctl.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
> index 4e11623..f1726d2 100644
> --- a/utilities/ovs-ofctl.c
> +++ b/utilities/ovs-ofctl.c
> @@ -3375,6 +3375,7 @@ read_flows_from_switch(struct vconn *vconn,
>
>          fte_queue(state, &fs->match, fs->priority, version, index);
>      }
> +    free(fses);
>  }
>

Should we also try to free fses[i].ofpacts ?


More information about the dev mailing list