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:
Juan RP
2012-06-16 09:02:07 +02:00
parent 068cab8d20
commit 974b2fe8ad
19 changed files with 28 additions and 96 deletions

View File

@ -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)