Skip to content

Commit

Permalink
ovsdb-idl: ovsdb_idl_loop_destroy must also destroy the committing txn.
Browse files Browse the repository at this point in the history
Found by AddressSanitizer when running OVN tests:
  Direct leak of 64 byte(s) in 1 object(s) allocated from:
      #0 0x498fb2 in calloc (/ic/ovn-ic+0x498fb2)
      openvswitch#1 0x5f681e in xcalloc__ ovs/lib/util.c:121:31
      openvswitch#2 0x5f681e in xzalloc__ ovs/lib/util.c:131:12
      openvswitch#3 0x5f681e in xzalloc ovs/lib/util.c:165:12
      #4 0x5e3697 in ovsdb_idl_txn_add_map_op ovs/lib/ovsdb-idl.c:4057:29
      #5 0x4d3f25 in update_isb_pb_external_ids ic/ovn-ic.c:576:5
      openvswitch#6 0x4cc4cc in create_isb_pb ic/ovn-ic.c:716:5
      #7 0x4cc4cc in port_binding_run ic/ovn-ic.c:803:21
      #8 0x4cc4cc in ovn_db_run ic/ovn-ic.c:1700:5
      #9 0x4c9c1c in main ic/ovn-ic.c:1984:17
      #10 0x7f9ad9f4a0b2 in __libc_start_main

Signed-off-by: Dumitru Ceara <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
  • Loading branch information
dceara authored and igsilya committed Jan 31, 2022
1 parent 712202f commit 53a540e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ovsdb-idl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4242,6 +4242,10 @@ void
ovsdb_idl_loop_destroy(struct ovsdb_idl_loop *loop)
{
if (loop) {
if (loop->committing_txn) {
ovsdb_idl_txn_abort(loop->committing_txn);
ovsdb_idl_txn_destroy(loop->committing_txn);
}
ovsdb_idl_destroy(loop->idl);
}
}
Expand Down

0 comments on commit 53a540e

Please sign in to comment.