[ovs-dev] [PATCH 1/1] db-ctl-base: fix memory leak in cmd-get() function

Damijan Skvarc damjan.skvarc at gmail.com
Fri Jul 5 11:38:47 UTC 2019


Memory leak occured in case specified key was not found in table
record.

Signed-off-by: Damijan Skvarc <damjan.skvarc at gmail.com>
---
 lib/db-ctl-base.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/db-ctl-base.c b/lib/db-ctl-base.c
index fc09293..3bd9f00 100644
--- a/lib/db-ctl-base.c
+++ b/lib/db-ctl-base.c
@@ -986,6 +986,7 @@ cmd_get(struct ctl_context *ctx)
                         ctx, "no key \"%s\" in %s record \"%s\" column %s",
                         key_string, table->name, record_id, column->name);
                     free(key_string);
+                    ovsdb_atom_destroy(&key, column->type.key.type);
                     return;
                 }
             } else {
-- 
2.7.4



More information about the dev mailing list