diff mbox series

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

Message ID 1562326727-31933-1-git-send-email-damjan.skvarc@gmail.com
State Accepted
Commit 7b34595d88db0460a22a9e8451ca5c766708cb8d
Headers show
Series [ovs-dev,1/1] db-ctl-base: fix memory leak in cmd-get() function | expand

Commit Message

Damijan Skvarc July 5, 2019, 11:38 a.m. UTC
Memory leak occured in case specified key was not found in table
record.

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

Comments

Ben Pfaff July 5, 2019, 4:55 p.m. UTC | #1
On Fri, Jul 05, 2019 at 01:38:47PM +0200, Damijan Skvarc wrote:
> Memory leak occured in case specified key was not found in table
> record.
> 
> Signed-off-by: Damijan Skvarc <damjan.skvarc@gmail.com>

Thanks!  Applied to master.
diff mbox series

Patch

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 {