cli: resolve uninitialized pointer warnings reported by GCC 12

master
Ariadne Conill 2022-08-07 00:38:38 +00:00
parent b310728111
commit 56881f64f0
1 changed files with 6 additions and 6 deletions

View File

@ -1162,7 +1162,7 @@ main(int argc, char *argv[])
if (required_module_version != NULL) if (required_module_version != NULL)
{ {
pkgconf_pkg_t *pkg; pkgconf_pkg_t *pkg = NULL;
pkgconf_node_t *node; pkgconf_node_t *node;
pkgconf_list_t deplist = PKGCONF_LIST_INITIALIZER; pkgconf_list_t deplist = PKGCONF_LIST_INITIALIZER;
@ -1195,14 +1195,14 @@ main(int argc, char *argv[])
ret = EXIT_FAILURE; ret = EXIT_FAILURE;
cleanup: cleanup:
if (pkg) if (pkg != NULL)
pkgconf_pkg_unref(&pkg_client, pkg); pkgconf_pkg_unref(&pkg_client, pkg);
pkgconf_dependency_free(&deplist); pkgconf_dependency_free(&deplist);
goto out; goto out;
} }
else if (required_exact_module_version != NULL) else if (required_exact_module_version != NULL)
{ {
pkgconf_pkg_t *pkg; pkgconf_pkg_t *pkg = NULL;
pkgconf_node_t *node; pkgconf_node_t *node;
pkgconf_list_t deplist = PKGCONF_LIST_INITIALIZER; pkgconf_list_t deplist = PKGCONF_LIST_INITIALIZER;
@ -1235,14 +1235,14 @@ cleanup:
ret = EXIT_FAILURE; ret = EXIT_FAILURE;
cleanup2: cleanup2:
if (pkg) if (pkg != NULL)
pkgconf_pkg_unref(&pkg_client, pkg); pkgconf_pkg_unref(&pkg_client, pkg);
pkgconf_dependency_free(&deplist); pkgconf_dependency_free(&deplist);
goto out; goto out;
} }
else if (required_max_module_version != NULL) else if (required_max_module_version != NULL)
{ {
pkgconf_pkg_t *pkg; pkgconf_pkg_t *pkg = NULL;
pkgconf_node_t *node; pkgconf_node_t *node;
pkgconf_list_t deplist = PKGCONF_LIST_INITIALIZER; pkgconf_list_t deplist = PKGCONF_LIST_INITIALIZER;
@ -1275,7 +1275,7 @@ cleanup2:
ret = EXIT_FAILURE; ret = EXIT_FAILURE;
cleanup3: cleanup3:
if (pkg) if (pkg != NULL)
pkgconf_pkg_unref(&pkg_client, pkg); pkgconf_pkg_unref(&pkg_client, pkg);
pkgconf_dependency_free(&deplist); pkgconf_dependency_free(&deplist);
goto out; goto out;