When local_options are present but no command name follows, the early return leaked the previously allocated commands array.
Free commands before returning the error string. Found by OpenScanHub Coverity (RESOURCE_LEAK). Signed-off-by: Timothy Redaelli <[email protected]> --- 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 bd3a21dd9..67ef0215e 100644 --- a/lib/db-ctl-base.c +++ b/lib/db-ctl-base.c @@ -2480,6 +2480,7 @@ ctl_parse_commands(int argc, char *argv[], struct shash *local_options, n_commands++; } else if (!shash_is_empty(local_options)) { + free(commands); return xstrdup("missing command name (use --help for help)"); } start = i + 1; -- 2.54.0 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
