core: free config_cli before exit() from main

[thaller@redhat.com: changed commit message]

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/954
This commit is contained in:
echengqi 2021-08-06 09:57:13 +08:00 committed by Thomas Haller
parent e11b8b94e3
commit 97041efee1
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -326,6 +326,7 @@ main(int argc, char *argv[])
if (global_opt.show_version) {
fprintf(stdout, NM_DIST_VERSION "\n");
nm_config_cmd_line_options_free(config_cli);
exit(0);
}
@ -374,6 +375,7 @@ main(int argc, char *argv[])
fprintf(stderr,
_("%s. Please use --help to see a list of valid options.\n"),
error->message);
nm_config_cmd_line_options_free(config_cli);
exit(1);
}