summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-04-24 18:58:34 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-04-24 18:58:34 +0000
commitabbb2cfcf045a8f309a233030154b6316be813de (patch)
treeb394bc07b5f3201ec3a3a7d61e9b7a1b3eb84424
parent5a13de80a1143ce42a9cef7d65a2f9d0e52eab46 (diff)
code cleanup
-rw-r--r--lib/libalpm/alpm.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c
index bf73d649..8f5a1649 100644
--- a/lib/libalpm/alpm.c
+++ b/lib/libalpm/alpm.c
@@ -68,6 +68,9 @@ int alpm_initialize(char *root)
ASSERT(handle == NULL, RET_ERR(PM_ERR_HANDLE_NOT_NULL, -1));
handle = handle_new();
+ if(handle == NULL) {
+ RET_ERR(PM_ERR_MEM_ERROR, -1);
+ }
/* lock db */
if(handle->access == PM_ACCESS_RW) {
@@ -440,9 +443,6 @@ int alpm_pkg_load(char *filename, pmpkg_t **pkg)
void alpm_pkg_free(pmpkg_t *pkg)
{
- if(pkg == NULL) {
- return;
- }
pkg_free(pkg);
}
@@ -699,11 +699,7 @@ void *alpm_list_getdata(PMList *entry)
int alpm_list_free(PMList *entry)
{
- if(entry) {
- /* ORE
- does not free all memory for packages... */
- FREELIST(entry);
- }
+ FREELIST(entry);
return(0);
}