enum pakfire_hash_type hash = PAKFIRE_HASH_UNDEFINED;
const unsigned char* checksum = NULL;
size_t checksum_length = 0;
+ char** build_arches = NULL;
+ pakfire_repo* repo = NULL;
+ char** groups = NULL;
char* result = NULL;
+ char** deps = NULL;
char** s = NULL;
int r;
}
// Repository
- pakfire_repo* repo = pakfire_package_get_repo(pkg);
+ repo = pakfire_package_get_repo(pkg);
if (repo) {
if (!pakfire_repo_name_equals(repo, PAKFIRE_REPO_DUMMY)) {
const char* repo_name = pakfire_repo_get_name(repo);
if (r < 0)
goto ERROR;
}
-
- pakfire_repo_unref(repo);
}
// Summary
}
// Groups
- char** groups = pakfire_package_get_strings(pkg, PAKFIRE_PKG_GROUPS);
+ groups = pakfire_package_get_strings(pkg, PAKFIRE_PKG_GROUPS);
if (groups) {
r = pakfire_package_dump_add_lines(&s, _("Groups"), groups);
if (r < 0)
goto ERROR;
-
- // XXX Needs free on error
- pakfire_strings_free(groups);
}
// URL
}
// Build Arches
- char** build_arches = pakfire_package_get_strings(pkg, PAKFIRE_PKG_BUILD_ARCHES);
+ build_arches = pakfire_package_get_strings(pkg, PAKFIRE_PKG_BUILD_ARCHES);
if (build_arches) {
r = pakfire_package_dump_add_lines(&s, _("Build Arch"), build_arches);
if (r < 0)
goto ERROR;
-
- // XXX needs free on error
- pakfire_strings_free(build_arches);
}
// Digest
// Dependencies
for (const struct pakfire_dep* dep = pakfire_deps; dep->key; dep++) {
- char** deps = pakfire_package_get_deps(pkg, dep->key);
+ deps = pakfire_package_get_deps(pkg, dep->key);
if (deps) {
size_t count = 0;
if (r < 0)
goto ERROR;
- // XXX needs free on error
pakfire_strings_free(deps);
+ deps = NULL;
}
}
}
result = pakfire_string_join((const char**)s, "");
ERROR:
+ if (build_arches)
+ pakfire_strings_free(build_arches);
+ if (groups)
+ pakfire_strings_free(groups);
+ if (deps)
+ pakfire_strings_free(deps);
+ if (repo)
+ pakfire_repo_unref(repo);
if (s)
pakfire_strings_free(s);