diff options
author | Damijan Skvarc <damjan.skvarc@gmail.com> | 2019-07-03 13:50:40 +0200 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2019-07-03 09:44:36 -0700 |
commit | ad16ffd11a9c88dc8cd160039d8f86b77d1d803d (patch) | |
tree | f526eb7649b71fae5e5c282d5ffe2abd4c3390d8 /ovn | |
parent | f87c1357067e1f67087eab4af42e5aaf7bf6cc8e (diff) | |
download | openvswitch-ad16ffd11a9c88dc8cd160039d8f86b77d1d803d.tar.gz |
ovn-nbctl: fix memory leak
Patch is mostly intended to prevent valgrind to report memory leak issues
while running unit tests. Otherwise it does not benefit anything since
the application exits immediately after freeing the memory.
Signed-off-by: Damijan Skvarc <damjan.skvarc@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ovn')
-rw-r--r-- | ovn/utilities/ovn-nbctl.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index e86ab7f7a..98a8faa0b 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -156,6 +156,7 @@ main(int argc, char *argv[]) char *error_s = ovs_cmdl_parse_all(argc, argv, get_all_options(), &parsed_options, &n_parsed_options); if (error_s) { + free(args); ctl_fatal("%s", error_s); } @@ -181,6 +182,7 @@ main(int argc, char *argv[]) bool daemon_mode = false; if (get_detach()) { if (argc != optind) { + free(args); ctl_fatal("non-option arguments not supported with --detach " "(use --help for help)"); } @@ -203,6 +205,7 @@ main(int argc, char *argv[]) error = ctl_parse_commands(argc - optind, argv + optind, &local_options, &commands, &n_commands); if (error) { + free(args); ctl_fatal("%s", error); } VLOG(ctl_might_write_to_db(commands, n_commands) ? VLL_INFO : VLL_DBG, @@ -212,11 +215,13 @@ main(int argc, char *argv[]) error = run_prerequisites(commands, n_commands, idl); if (error) { + free(args); ctl_fatal("%s", error); } error = main_loop(args, commands, n_commands, idl, NULL); if (error) { + free(args); ctl_fatal("%s", error); } |