summaryrefslogtreecommitdiff
path: root/lib/libalpm/add.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2006-02-20 20:41:40 +0000
committerAurelien Foret <aurelien@archlinux.org>2006-02-20 20:41:40 +0000
commit590f610d6b79d4bec993e03bebf7d0850b470f6d (patch)
tree8bfa451105a1995c04d19b1cba4a389bfd6fab52 /lib/libalpm/add.c
parenta5f67ef81983fdddc50851a82ecd664efab115d1 (diff)
dropped the MALLOC macro
Diffstat (limited to 'lib/libalpm/add.c')
-rw-r--r--lib/libalpm/add.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index 5d29abdd..e3c5174c 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -57,7 +57,8 @@ static int add_faketarget(pmtrans_t *trans, char *name)
char *str = NULL;
pmpkg_t *dummy = NULL;
- if((dummy = _alpm_pkg_new(NULL, NULL)) == NULL) {
+ dummy = _alpm_pkg_new(NULL, NULL);
+ if(dummy == NULL) {
RET_ERR(PM_ERR_MEMORY, -1);
}
@@ -457,7 +458,10 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
if(!strcmp(file, pathname)) {
char *fn;
/* 32 for the hash, 1 for the terminating NULL, and 1 for the tab delimiter */
- MALLOC(fn, strlen(file)+34);
+ fn = (char *)malloc(strlen(file)+34);
+ if(fn == NULL) {
+ RET_ERR(PM_ERR_MEMORY, -1);
+ }
sprintf(fn, "%s\t%s", file, md5_pkg);
FREE(file);
lp->data = fn;
@@ -568,7 +572,10 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
snprintf(path, PATH_MAX, "%s%s", handle->root, file);
md5 = MDFile(path);
/* 32 for the hash, 1 for the terminating NULL, and 1 for the tab delimiter */
- MALLOC(fn, strlen(file)+34);
+ fn = (char *)malloc(strlen(file)+34);
+ if(fn == NULL) {
+ RET_ERR(PM_ERR_MEMORY, -1);
+ }
sprintf(fn, "%s\t%s", file, md5);
FREE(md5);
FREE(file);