diff mbox

[ovs-dev] ovsdb-client: Fix memory leak reported by valgind.

Message ID 1455057076-60002-1-git-send-email-u9012063@gmail.com
State Accepted
Headers show

Commit Message

William Tu Feb. 9, 2016, 10:31 p.m. UTC
Testcase 1429: ovsdb-server/add-db and remove-db.
    xmemdup0 (util.c:142)
    main (ovsdb-client.c:133)

Signed-off-by: William Tu <u9012063@gmail.com>
---
Comments:
This testcase happens to exercise the error and exit case, thus valgrind 
complains about memory leak.
---
 ovsdb/ovsdb-client.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Ben Pfaff Feb. 10, 2016, 7:19 p.m. UTC | #1
On Tue, Feb 09, 2016 at 02:31:16PM -0800, William Tu wrote:
> Testcase 1429: ovsdb-server/add-db and remove-db.
>     xmemdup0 (util.c:142)
>     main (ovsdb-client.c:133)
> 
> Signed-off-by: William Tu <u9012063@gmail.com>
> ---
> Comments:
> This testcase happens to exercise the error and exit case, thus valgrind 
> complains about memory leak.

Applied, thanks!
diff mbox

Patch

diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c
index 06155ec..980cd9a 100644
--- a/ovsdb/ovsdb-client.c
+++ b/ovsdb/ovsdb-client.c
@@ -145,6 +145,7 @@  main(int argc, char *argv[])
 
     if (argc - optind < command->min_args ||
         argc - optind > command->max_args) {
+        free(database);
         VLOG_FATAL("invalid syntax for '%s' (use --help for help)",
                     command->name);
     }