libxbps: simplify pkgdb_get_pkgd and find_pkg_dict_installed internals.
There's no need to prop_dictionary_copy the returned dictionary to later have to free it again, just return directly the dictionary and avoid the free(3)s.
This commit is contained in:
@ -197,7 +197,6 @@ main(int argc, char **argv)
|
||||
"pkgname", &pkgn);
|
||||
prop_dictionary_get_cstring_nocopy(pkgd,
|
||||
"version", &version);
|
||||
prop_object_release(pkgd);
|
||||
fprintf(stderr, "%s%s=> ERROR: `%s-%s' is already "
|
||||
"registered!%s\n", MSG_ERROR,
|
||||
in_chroot ? "[chroot] " : "",
|
||||
@ -251,7 +250,6 @@ main(int argc, char **argv)
|
||||
}
|
||||
prop_dictionary_get_cstring_nocopy(dict, "version", &version);
|
||||
printf("%s\n", version);
|
||||
prop_object_release(dict);
|
||||
} else if (strcasecmp(argv[0], "sanitize-plist") == 0) {
|
||||
/* Sanitize a plist file (properly indent the file) */
|
||||
if (argc != 2)
|
||||
|
Reference in New Issue
Block a user