alpm_list_reverse: restore original list on failure
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
845dadf183
commit
2079f6866a
1 changed files with 1 additions and 0 deletions
|
@ -417,6 +417,7 @@ alpm_list_t SYMEXPORT *alpm_list_reverse(alpm_list_t *list)
|
||||||
while(lp) {
|
while(lp) {
|
||||||
if(alpm_list_append(&newlist, lp->data) == NULL) {
|
if(alpm_list_append(&newlist, lp->data) == NULL) {
|
||||||
alpm_list_free(newlist);
|
alpm_list_free(newlist);
|
||||||
|
list->prev = backup;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
lp = lp->prev;
|
lp = lp->prev;
|
||||||
|
|
Loading…
Add table
Reference in a new issue