diff mbox series

[ovs-dev,06/10] ovsdb-client: Free ovsdb_schema

Message ID 1568236716-18105-6-git-send-email-pkusunyifeng@gmail.com
State Accepted
Commit 48d8a65e75c7de6ca25589779ea397cd331b15b1
Headers show
Series [ovs-dev,01/10] raft: Free leaked json data | expand

Commit Message

Yifeng Sun Sept. 11, 2019, 9:18 p.m. UTC
Valgrind reported:

1925: schema conversion online - standalone

==10727== 689 (56 direct, 633 indirect) bytes in 1 blocks are definitely lost in loss record 64 of 66
==10727==    at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==10727==    by 0x449D42: xcalloc (util.c:121)
==10727==    by 0x40F45C: ovsdb_schema_create (ovsdb.c:41)
==10727==    by 0x40F7F8: ovsdb_schema_from_json (ovsdb.c:217)
==10727==    by 0x40FB4E: ovsdb_schema_from_file (ovsdb.c:101)
==10727==    by 0x40B156: do_convert (ovsdb-client.c:1639)
==10727==    by 0x4061C6: main (ovsdb-client.c:282)

This patch fixes it.

Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
---
 ovsdb/ovsdb-client.c | 1 +
 1 file changed, 1 insertion(+)

Comments

William Tu Sept. 17, 2019, 5:09 p.m. UTC | #1
On Wed, Sep 11, 2019 at 02:18:32PM -0700, Yifeng Sun wrote:
> Valgrind reported:
> 
> 1925: schema conversion online - standalone
> 
> ==10727== 689 (56 direct, 633 indirect) bytes in 1 blocks are definitely lost in loss record 64 of 66
> ==10727==    at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==10727==    by 0x449D42: xcalloc (util.c:121)
> ==10727==    by 0x40F45C: ovsdb_schema_create (ovsdb.c:41)
> ==10727==    by 0x40F7F8: ovsdb_schema_from_json (ovsdb.c:217)
> ==10727==    by 0x40FB4E: ovsdb_schema_from_file (ovsdb.c:101)
> ==10727==    by 0x40B156: do_convert (ovsdb-client.c:1639)
> ==10727==    by 0x4061C6: main (ovsdb-client.c:282)
> 
> This patch fixes it.
> 
> Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
LGTM
Acked-by: William Tu <u9012063@gmail.com>

> ---
>  ovsdb/ovsdb-client.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c
> index 9ae15e557661..bfc90e6f7f85 100644
> --- a/ovsdb/ovsdb-client.c
> +++ b/ovsdb/ovsdb-client.c
> @@ -1654,6 +1654,7 @@ do_convert(struct jsonrpc *rpc, const char *database_ OVS_UNUSED,
>                              ovsdb_schema_to_json(new_schema)), NULL);
>      check_txn(jsonrpc_transact_block(rpc, request, &reply), &reply);
>      jsonrpc_msg_destroy(reply);
> +    ovsdb_schema_destroy(new_schema);
>  }
>  
>  static void
> -- 
> 2.7.4
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
diff mbox series

Patch

diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c
index 9ae15e557661..bfc90e6f7f85 100644
--- a/ovsdb/ovsdb-client.c
+++ b/ovsdb/ovsdb-client.c
@@ -1654,6 +1654,7 @@  do_convert(struct jsonrpc *rpc, const char *database_ OVS_UNUSED,
                             ovsdb_schema_to_json(new_schema)), NULL);
     check_txn(jsonrpc_transact_block(rpc, request, &reply), &reply);
     jsonrpc_msg_destroy(reply);
+    ovsdb_schema_destroy(new_schema);
 }
 
 static void