diff mbox

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

Message ID 1486536071-14280-2-git-send-email-u9012063@gmail.com
State Superseded
Headers show

Commit Message

William Tu Feb. 8, 2017, 6:41 a.m. UTC
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@gmail.com>
---
 utilities/ovs-ofctl.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Andy Zhou Feb. 8, 2017, 7:25 a.m. UTC | #1
On Tue, Feb 7, 2017 at 10:41 PM, William Tu <u9012063@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@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 ?
William Tu Feb. 8, 2017, 2:42 p.m. UTC | #2
yes, thanks. I will submit v2.

On Tue, Feb 7, 2017 at 11:25 PM, Andy Zhou <azhou@ovn.org> wrote:
> On Tue, Feb 7, 2017 at 10:41 PM, William Tu <u9012063@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@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 ?
diff mbox

Patch

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);
 }
 
 static void