diff options
author | Aurelien Foret <aurelien@archlinux.org> | 2006-02-20 20:41:40 +0000 |
---|---|---|
committer | Aurelien Foret <aurelien@archlinux.org> | 2006-02-20 20:41:40 +0000 |
commit | 590f610d6b79d4bec993e03bebf7d0850b470f6d (patch) | |
tree | 8bfa451105a1995c04d19b1cba4a389bfd6fab52 /lib/libalpm/package.c | |
parent | a5f67ef81983fdddc50851a82ecd664efab115d1 (diff) | |
download | pacman-590f610d6b79d4bec993e03bebf7d0850b470f6d.tar.xz |
dropped the MALLOC macro
Diffstat (limited to 'lib/libalpm/package.c')
-rw-r--r-- | lib/libalpm/package.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 7767297a..fe568fe0 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -39,7 +39,10 @@ pmpkg_t *_alpm_pkg_new(const char *name, const char *version) { pmpkg_t* pkg = NULL; - MALLOC(pkg, sizeof(pmpkg_t)); + pkg = (pmpkg_t *)malloc(sizeof(pmpkg_t)); + if(pkg == NULL) { + RET_ERR(PM_ERR_MEMORY, NULL); + } if(name && name[0] != 0) { STRNCPY(pkg->name, name, PKG_NAME_LEN); @@ -313,7 +316,10 @@ pmpkg_t *_alpm_pkg_load(char *pkgfile) char *str; int fd; - MALLOC(str, PATH_MAX); + str = (char *)malloc(PATH_MAX); + if(str == NULL) { + RET_ERR(PM_ERR_MEMORY, NULL); + } fn = strdup("/tmp/alpm_XXXXXX"); fd = mkstemp(fn); tar_extract_file(tar, fn); |