summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/package.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/package.c')
-rw-r--r--lib/libalpm/package.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index f720bd7f..1faf2f2d 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -546,16 +546,17 @@ void _alpm_pkg_update_requiredby(pmpkg_t *pkg)
}
pmpkg_t *cachepkg = i->data;
for(j = alpm_pkg_get_depends(cachepkg); j; j = j->next) {
- pmdepend_t dep;
+ pmdepend_t *dep;
if(!j->data) {
continue;
}
- if(_alpm_splitdep(j->data, &dep) != 0) {
- continue;
+ dep = _alpm_splitdep(j->data);
+ if(dep == NULL) {
+ continue;
}
-
+
/* check the actual package itself */
- if(strcmp(dep.name, alpm_pkg_get_name(pkg)) == 0) {
+ if(strcmp(dep->name, alpm_pkg_get_name(pkg)) == 0) {
_alpm_log(PM_LOG_DEBUG, _("adding '%s' in requiredby field for '%s'"),
cachepkg->name, pkg->name);
alpm_list_t *reqs = alpm_pkg_get_requiredby(pkg);
@@ -566,7 +567,7 @@ void _alpm_pkg_update_requiredby(pmpkg_t *pkg)
/* check for provisions as well */
for(k = alpm_pkg_get_provides(pkg); k; k = k->next) {
const char *provname = k->data;
- if(strcmp(dep.name, provname) == 0) {
+ if(strcmp(dep->name, provname) == 0) {
_alpm_log(PM_LOG_DEBUG, _("adding '%s' in requiredby field for '%s' (provides: %s)"),
alpm_pkg_get_name(cachepkg), alpm_pkg_get_name(pkg), provname);
alpm_list_t *reqs = alpm_pkg_get_requiredby(pkg);
@@ -574,6 +575,7 @@ void _alpm_pkg_update_requiredby(pmpkg_t *pkg)
pkg->requiredby = reqs;
}
}
+ free(dep);
}
}
}