summaryrefslogtreecommitdiff
path: root/lib/libalpm/sync.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2006-03-01 07:51:00 +0000
committerAurelien Foret <aurelien@archlinux.org>2006-03-01 07:51:00 +0000
commit0b4ab2c0a80e8581e2caa50e809af7f5573c0e48 (patch)
tree27a907f06e52ecb8ea1c5931350993bd38c89a06 /lib/libalpm/sync.c
parentce4c043805865f745e6aa8762455a2f9b19b25cd (diff)
downloadpacman-0b4ab2c0a80e8581e2caa50e809af7f5573c0e48.tar.xz
added ERROR logs in case of malloc failures (patch from VMiklos <vmiklos@frugalware.org>)
Diffstat (limited to 'lib/libalpm/sync.c')
-rw-r--r--lib/libalpm/sync.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 20d50dc2..58a3e3ce 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -53,6 +53,7 @@ pmsyncpkg_t *_alpm_sync_new(int type, pmpkg_t *spkg, void *data)
pmsyncpkg_t *sync;
if((sync = (pmsyncpkg_t *)malloc(sizeof(pmsyncpkg_t))) == NULL) {
+ _alpm_log(PM_LOG_ERROR, "malloc failure: could not allocate %d bytes", sizeof(pmsyncpkg_t));
return(NULL);
}
@@ -571,6 +572,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PML
errorout = 1;
if(data) {
if((miss = (pmdepmissing_t *)malloc(sizeof(pmdepmissing_t))) == NULL) {
+ _alpm_log(PM_LOG_ERROR, "malloc failure: could not allocate %d bytes", sizeof(pmdepmissing_t));
FREELIST(*data);
pm_errno = PM_ERR_MEMORY;
goto error;
@@ -585,6 +587,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PML
errorout = 1;
if(data) {
if((miss = (pmdepmissing_t *)malloc(sizeof(pmdepmissing_t))) == NULL) {
+ _alpm_log(PM_LOG_ERROR, "malloc failure: could not allocate %d bytes", sizeof(pmdepmissing_t));
FREELIST(*data);
pm_errno = PM_ERR_MEMORY;
goto error;
@@ -676,6 +679,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PML
}
if(data) {
if((miss = (pmdepmissing_t *)malloc(sizeof(pmdepmissing_t))) == NULL) {
+ _alpm_log(PM_LOG_ERROR, "malloc failure: could not allocate %d bytes", sizeof(pmdepmissing_t));
FREELIST(*data);
pm_errno = PM_ERR_MEMORY;
goto error;