mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2026-01-04 19:24:20 +00:00
devlink: Call dl_free in early exit case
Prior to parsing command options, the devlink tool allocates memory to store results. In case of early exit (wrong parameters or version check), this memory wasn't freed. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com>
This commit is contained in:
parent
5e4dc1951e
commit
b77c77d294
@ -2579,7 +2579,8 @@ int main(int argc, char **argv)
|
||||
switch (opt) {
|
||||
case 'V':
|
||||
printf("devlink utility, iproute2-ss%s\n", SNAPSHOT);
|
||||
return EXIT_SUCCESS;
|
||||
ret = EXIT_SUCCESS;
|
||||
goto dl_free;
|
||||
case 'n':
|
||||
dl->no_nice_names = true;
|
||||
break;
|
||||
@ -2592,7 +2593,8 @@ int main(int argc, char **argv)
|
||||
default:
|
||||
pr_err("Unknown option.\n");
|
||||
help();
|
||||
return EXIT_FAILURE;
|
||||
ret = EXIT_FAILURE;
|
||||
goto dl_free;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user