summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-03-26 09:00:49 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-03-26 09:00:49 +0000
commit10b0e0d9af0e396d30f6fb1f5d321488897746d3 (patch)
tree54019ca547b4155aba371a5d9c5dd51d92406c1b
parent3f165e19129f4962231a2f4ce2fb581e8ba1ec9d (diff)
downloadpacman-10b0e0d9af0e396d30f6fb1f5d321488897746d3.tar.xz
Backport from pacman 2.9.5
-rw-r--r--lib/libalpm/list.c3
-rw-r--r--lib/libalpm/list.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/libalpm/list.c b/lib/libalpm/list.c
index 9b3b11e9..8fda583f 100644
--- a/lib/libalpm/list.c
+++ b/lib/libalpm/list.c
@@ -89,6 +89,9 @@ PMList* pm_list_add(PMList *list, void *data)
ptr = list;
if(ptr == NULL) {
ptr = pm_list_new();
+ if(ptr == NULL) {
+ return(NULL);
+ }
}
lp = pm_list_last(ptr);
diff --git a/lib/libalpm/list.h b/lib/libalpm/list.h
index fe0d6738..e7c9eb31 100644
--- a/lib/libalpm/list.h
+++ b/lib/libalpm/list.h
@@ -26,7 +26,7 @@ typedef struct __pmlist_t {
void *data;
struct __pmlist_t *prev;
struct __pmlist_t *next;
- struct __pmlist_t *last;
+ struct __pmlist_t *last; /* Quick access to last item in list */
} pmlist_t;
typedef struct __pmlist_t PMList;