summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/trans.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/trans.c')
-rw-r--r--lib/libalpm/trans.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index b8f87371..1f9f225a 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -229,10 +229,7 @@ pmtrans_t *_alpm_trans_new()
ALPM_LOG_FUNC;
- if((trans = malloc(sizeof(pmtrans_t))) == NULL) {
- _alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes\n"), sizeof(pmtrans_t));
- return(NULL);
- }
+ CALLOC(trans, 1, sizeof(pmtrans_t), RET_ERR(PM_ERR_MEMORY, NULL));
trans->targets = NULL;
trans->packages = NULL;