mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-23 00:08:50 -05:00
- fixed args order in list_is_ptrin()
- fixed several memory leaks
This commit is contained in:
parent
49d2cdc2f9
commit
b7d584feb6
@ -212,8 +212,10 @@ PMList *checkdeps(pmdb_t *db, unsigned char op, PMList *packages)
|
|||||||
STRNCPY(miss->target, p->name, PKG_NAME_LEN);
|
STRNCPY(miss->target, p->name, PKG_NAME_LEN);
|
||||||
STRNCPY(miss->depend.name, depend.name, PKG_NAME_LEN);
|
STRNCPY(miss->depend.name, depend.name, PKG_NAME_LEN);
|
||||||
STRNCPY(miss->depend.version, depend.version, PKG_VERSION_LEN);
|
STRNCPY(miss->depend.version, depend.version, PKG_VERSION_LEN);
|
||||||
if(!pm_list_is_ptrin(baddeps, miss)) {
|
if(!pm_list_is_ptrin(miss, baddeps)) {
|
||||||
baddeps = pm_list_add(baddeps, miss);
|
baddeps = pm_list_add(baddeps, miss);
|
||||||
|
} else {
|
||||||
|
FREE(miss);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FREEPKG(p);
|
FREEPKG(p);
|
||||||
@ -240,8 +242,10 @@ PMList *checkdeps(pmdb_t *db, unsigned char op, PMList *packages)
|
|||||||
miss->depend.version[0] = '\0';
|
miss->depend.version[0] = '\0';
|
||||||
STRNCPY(miss->target, tp->name, PKG_NAME_LEN);
|
STRNCPY(miss->target, tp->name, PKG_NAME_LEN);
|
||||||
STRNCPY(miss->depend.name, dp->name, PKG_NAME_LEN);
|
STRNCPY(miss->depend.name, dp->name, PKG_NAME_LEN);
|
||||||
if(!pm_list_is_ptrin(baddeps, miss)) {
|
if(!pm_list_is_ptrin(miss, baddeps)) {
|
||||||
baddeps = pm_list_add(baddeps, miss);
|
baddeps = pm_list_add(baddeps, miss);
|
||||||
|
} else {
|
||||||
|
FREE(miss);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -255,8 +259,10 @@ PMList *checkdeps(pmdb_t *db, unsigned char op, PMList *packages)
|
|||||||
miss->depend.version[0] = '\0';
|
miss->depend.version[0] = '\0';
|
||||||
STRNCPY(miss->target, tp->name, PKG_NAME_LEN);
|
STRNCPY(miss->target, tp->name, PKG_NAME_LEN);
|
||||||
STRNCPY(miss->depend.name, a->name, PKG_NAME_LEN);
|
STRNCPY(miss->depend.name, a->name, PKG_NAME_LEN);
|
||||||
if(!pm_list_is_ptrin(baddeps, miss)) {
|
if(!pm_list_is_ptrin(miss, baddeps)) {
|
||||||
baddeps = pm_list_add(baddeps, miss);
|
baddeps = pm_list_add(baddeps, miss);
|
||||||
|
} else {
|
||||||
|
FREE(miss);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -272,8 +278,10 @@ PMList *checkdeps(pmdb_t *db, unsigned char op, PMList *packages)
|
|||||||
miss->depend.version[0] = '\0';
|
miss->depend.version[0] = '\0';
|
||||||
STRNCPY(miss->target, tp->name, PKG_NAME_LEN);
|
STRNCPY(miss->target, tp->name, PKG_NAME_LEN);
|
||||||
STRNCPY(miss->depend.name, info->name, PKG_NAME_LEN);
|
STRNCPY(miss->depend.name, info->name, PKG_NAME_LEN);
|
||||||
if(!pm_list_is_ptrin(baddeps, miss)) {
|
if(!pm_list_is_ptrin(miss, baddeps)) {
|
||||||
baddeps = pm_list_add(baddeps, miss);
|
baddeps = pm_list_add(baddeps, miss);
|
||||||
|
} else {
|
||||||
|
FREE(miss);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -411,8 +419,10 @@ PMList *checkdeps(pmdb_t *db, unsigned char op, PMList *packages)
|
|||||||
STRNCPY(miss->target, tp->name, PKG_NAME_LEN);
|
STRNCPY(miss->target, tp->name, PKG_NAME_LEN);
|
||||||
STRNCPY(miss->depend.name, depend.name, PKG_NAME_LEN);
|
STRNCPY(miss->depend.name, depend.name, PKG_NAME_LEN);
|
||||||
STRNCPY(miss->depend.version, depend.version, PKG_VERSION_LEN);
|
STRNCPY(miss->depend.version, depend.version, PKG_VERSION_LEN);
|
||||||
if(!pm_list_is_ptrin(baddeps, miss)) {
|
if(!pm_list_is_ptrin(miss, baddeps)) {
|
||||||
baddeps = pm_list_add(baddeps, miss);
|
baddeps = pm_list_add(baddeps, miss);
|
||||||
|
} else {
|
||||||
|
FREE(miss);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -433,8 +443,10 @@ PMList *checkdeps(pmdb_t *db, unsigned char op, PMList *packages)
|
|||||||
miss->depend.version[0] = '\0';
|
miss->depend.version[0] = '\0';
|
||||||
STRNCPY(miss->target, tp->name, PKG_NAME_LEN);
|
STRNCPY(miss->target, tp->name, PKG_NAME_LEN);
|
||||||
STRNCPY(miss->depend.name, (char *)j->data, PKG_NAME_LEN);
|
STRNCPY(miss->depend.name, (char *)j->data, PKG_NAME_LEN);
|
||||||
if(!pm_list_is_ptrin(baddeps, miss)) {
|
if(!pm_list_is_ptrin(miss, baddeps)) {
|
||||||
baddeps = pm_list_add(baddeps, miss);
|
baddeps = pm_list_add(baddeps, miss);
|
||||||
|
} else {
|
||||||
|
FREE(miss);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user