summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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;