Message ID | 20210604164813.11464-1-dceara@redhat.com |
---|---|
State | Accepted |
Headers | show |
Series | [ovs-dev] ovn-northd-ddlog: Fix memleak when destroying context. | expand |
On Fri, Jun 04, 2021 at 06:48:13PM +0200, Dumitru Ceara wrote: > This is benign but AddressSanitizer was complaining about it: > > Direct leak of 40 byte(s) in 1 object(s) allocated from: > #0 0x7fa93cd6d667 in __interceptor_malloc (/lib64/libasan.so.6+0xb0667) > #1 0x1be8d3e in xmalloc__ lib/util.c:137 > #2 0x1be8e1a in xmalloc lib/util.c:172 > #3 0x1b799d3 in json_create lib/json.c:1451 > #4 0x1b74314 in json_integer_create lib/json.c:263 > #5 0x1b7d38a in jsonrpc_create_id lib/jsonrpc.c:563 > #6 0x1b7d3a5 in jsonrpc_create_request lib/jsonrpc.c:570 > #7 0x1b8d851 in ovsdb_cs_send_transaction lib/ovsdb-cs.c:1376 > #8 0x40b017 in northd_send_output_only_data_request northd/ovn-northd-ddlog.c:290 > #9 0x40c802 in northd_run northd/ovn-northd-ddlog.c:568 > #10 0x410225 in main northd/ovn-northd-ddlog.c:1289 > #11 0x7fa93c4a9081 in __libc_start_main ../csu/libc-start.c:308 > > Signed-off-by: Dumitru Ceara <dceara@redhat.com> Thanks! Acked-by: Ben Pfaff <blp@ovn.org>
On 6/10/21 7:26 PM, Ben Pfaff wrote: > On Fri, Jun 04, 2021 at 06:48:13PM +0200, Dumitru Ceara wrote: >> This is benign but AddressSanitizer was complaining about it: >> >> Direct leak of 40 byte(s) in 1 object(s) allocated from: >> #0 0x7fa93cd6d667 in __interceptor_malloc (/lib64/libasan.so.6+0xb0667) >> #1 0x1be8d3e in xmalloc__ lib/util.c:137 >> #2 0x1be8e1a in xmalloc lib/util.c:172 >> #3 0x1b799d3 in json_create lib/json.c:1451 >> #4 0x1b74314 in json_integer_create lib/json.c:263 >> #5 0x1b7d38a in jsonrpc_create_id lib/jsonrpc.c:563 >> #6 0x1b7d3a5 in jsonrpc_create_request lib/jsonrpc.c:570 >> #7 0x1b8d851 in ovsdb_cs_send_transaction lib/ovsdb-cs.c:1376 >> #8 0x40b017 in northd_send_output_only_data_request northd/ovn-northd-ddlog.c:290 >> #9 0x40c802 in northd_run northd/ovn-northd-ddlog.c:568 >> #10 0x410225 in main northd/ovn-northd-ddlog.c:1289 >> #11 0x7fa93c4a9081 in __libc_start_main ../csu/libc-start.c:308 >> >> Signed-off-by: Dumitru Ceara <dceara@redhat.com> > > Thanks! > > Acked-by: Ben Pfaff <blp@ovn.org> I pushed this to the main branch as well as branch-21.06. > _______________________________________________ > dev mailing list > dev@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev >
diff --git a/northd/ovn-northd-ddlog.c b/northd/ovn-northd-ddlog.c index a4f2960bd..444e13e39 100644 --- a/northd/ovn-northd-ddlog.c +++ b/northd/ovn-northd-ddlog.c @@ -206,6 +206,7 @@ northd_ctx_destroy(struct northd_ctx *ctx) { if (ctx) { ovsdb_cs_destroy(ctx->cs); + json_destroy(ctx->request_id); json_destroy(ctx->output_only_data); free(ctx->prefix); free(ctx);
This is benign but AddressSanitizer was complaining about it: Direct leak of 40 byte(s) in 1 object(s) allocated from: #0 0x7fa93cd6d667 in __interceptor_malloc (/lib64/libasan.so.6+0xb0667) #1 0x1be8d3e in xmalloc__ lib/util.c:137 #2 0x1be8e1a in xmalloc lib/util.c:172 #3 0x1b799d3 in json_create lib/json.c:1451 #4 0x1b74314 in json_integer_create lib/json.c:263 #5 0x1b7d38a in jsonrpc_create_id lib/jsonrpc.c:563 #6 0x1b7d3a5 in jsonrpc_create_request lib/jsonrpc.c:570 #7 0x1b8d851 in ovsdb_cs_send_transaction lib/ovsdb-cs.c:1376 #8 0x40b017 in northd_send_output_only_data_request northd/ovn-northd-ddlog.c:290 #9 0x40c802 in northd_run northd/ovn-northd-ddlog.c:568 #10 0x410225 in main northd/ovn-northd-ddlog.c:1289 #11 0x7fa93c4a9081 in __libc_start_main ../csu/libc-start.c:308 Signed-off-by: Dumitru Ceara <dceara@redhat.com> --- northd/ovn-northd-ddlog.c | 1 + 1 file changed, 1 insertion(+)