Variable "want_key" in function check_condition and variable "key" in function 
set_column were not destroyed in exception branch.

This patch calls ovsdb_atom_destroy to release resources to avoid memory leak.

Fixes: 79c1a00fb5a5 ("db-ctl-base: Don't die in set_column() on error.")
Fixes: e09b3af3e249 ("db-ctl-base: Don't die in is_condition_satisfied() on 
error")
Signed-off-by: Zengyuan Wang <wangzengy...@huawei.com>
---
 lib/db-ctl-base.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/db-ctl-base.c b/lib/db-ctl-base.c
index 5d2635946..3a8068b12 100644
--- a/lib/db-ctl-base.c
+++ b/lib/db-ctl-base.c
@@ -820,6 +820,7 @@ check_condition(const struct ovsdb_idl_table_class *table,
         type.value.type = OVSDB_TYPE_VOID;
         error = ovsdb_datum_from_string(&b, &type, value_string, symtab);
         if (error) {
+            ovsdb_atom_destroy(&want_key, column->type.key.type);
             goto out;
         }
 
@@ -1374,6 +1375,7 @@ set_column(const struct ovsdb_idl_table_class *table,
         error = ovsdb_atom_from_string(&value, NULL, &column->type.value,
                                        value_string, symtab);
         if (error) {
+            ovsdb_atom_destroy(&key, column->type.key.type);
             goto out;
         }
 
-- 
2.22.0.windows.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to