Skip to content

Commit

Permalink
Fix memleak in ovn-nbctl when args can't be parsed
Browse files Browse the repository at this point in the history
The leak is reported for asan runs.

Signed-off-by: Ihar Hrachyshka <ihrachys@redhat.com>
Signed-off-by: Mark Michelson <mmichels@redhat.com>
Acked-by: Mark Michelson <mmichels@redhat.com>
  • Loading branch information
booxter authored and putnopvut committed Jun 27, 2022
1 parent 543c23c commit 9c29f55
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions utilities/ovn-dbctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@ ovn_dbctl_main(int argc, char *argv[],
error = ctl_parse_commands(argc - optind, argv_ + optind,
&local_options, &commands, &n_commands);
if (error) {
ovsdb_idl_destroy(idl);
idl = the_idl = NULL;

for (int i = 0; i < argc; i++) {
free(argv_[i]);
}
free(argv_);
ctl_fatal("%s", error);
}

Expand Down

0 comments on commit 9c29f55

Please sign in to comment.