Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/package.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/package.c
parenta5f67ef81983fdddc50851a82ecd664efab115d1 (diff)
dropped the MALLOC macro
Diffstat (limited to 'lib/libalpm/package.c')
-rw-r--r--lib/libalpm/package.c10
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);