diff mbox

[ovs-dev] ovsdb: Fix memory leak reported by valgrind.

Message ID 1469433629-19095-1-git-send-email-lirans@il.ibm.com
State Accepted
Headers show

Commit Message

Liran Schour July 25, 2016, 8 a.m. UTC
Destroy shash on destroy of session's condition structure.
Reported here: http://openvswitch.org/pipermail/dev/2016-July/075968.html

Signed-off-by: Liran Schour <lirans@il.ibm.com>
---
 ovsdb/monitor.c | 1 +
 1 file changed, 1 insertion(+)

Comments

William Tu July 25, 2016, 2:07 p.m. UTC | #1
Looks good to me, thanks for fixing it!

Acked-by: William Tu <u9012063@gmail.com>

On Mon, Jul 25, 2016 at 1:00 AM, Liran Schour <lirans@il.ibm.com> wrote:
> Destroy shash on destroy of session's condition structure.
> Reported here: http://openvswitch.org/pipermail/dev/2016-July/075968.html
>
> Signed-off-by: Liran Schour <lirans@il.ibm.com>
> ---
>  ovsdb/monitor.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/ovsdb/monitor.c b/ovsdb/monitor.c
> index 99083e1..9a6fbf5 100644
> --- a/ovsdb/monitor.c
> +++ b/ovsdb/monitor.c
> @@ -617,6 +617,7 @@ ovsdb_monitor_session_condition_destroy(
>          shash_delete(&condition->tables, node);
>          free(mtc);
>      }
> +    shash_destroy(&condition->tables);
>      free(condition);
>  }
>
> --
> 2.1.4
>
Ben Pfaff July 27, 2016, 8:55 p.m. UTC | #2
On Mon, Jul 25, 2016 at 11:00:29AM +0300, Liran Schour wrote:
> Destroy shash on destroy of session's condition structure.
> Reported here: http://openvswitch.org/pipermail/dev/2016-July/075968.html
> 
> Signed-off-by: Liran Schour <lirans@il.ibm.com>

Applied, thanks!
diff mbox

Patch

diff --git a/ovsdb/monitor.c b/ovsdb/monitor.c
index 99083e1..9a6fbf5 100644
--- a/ovsdb/monitor.c
+++ b/ovsdb/monitor.c
@@ -617,6 +617,7 @@  ovsdb_monitor_session_condition_destroy(
         shash_delete(&condition->tables, node);
         free(mtc);
     }
+    shash_destroy(&condition->tables);
     free(condition);
 }