Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/delta.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-07 16:06:16 -0500
committerDan McGee <dan@archlinux.org>2011-06-13 19:38:38 -0500
commite2aa952689da8763d534d1c19310eb97009f4f76 (patch)
tree7d022d67801bc01c24fef985feb9a617c48d316a /lib/libalpm/delta.c
parent8b62d9bc0ade64897990b8fc6a1b6a54b629cb5b (diff)
Move pm_errno onto the handle
This involves some serious changes and a very messy diff, unfortunately. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/delta.c')
-rw-r--r--lib/libalpm/delta.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/libalpm/delta.c b/lib/libalpm/delta.c
index 645c7bac..ad2be77e 100644
--- a/lib/libalpm/delta.c
+++ b/lib/libalpm/delta.c
@@ -78,6 +78,10 @@ static alpm_list_t *graph_init(alpm_list_t *deltas, int reverse)
/* create the vertices */
for(i = deltas; i; i = i->next) {
pmgraph_t *v = _alpm_graph_new();
+ if(!v) {
+ alpm_list_free(vertices);
+ return NULL;
+ }
pmdelta_t *vdelta = i->data;
vdelta->download_size = vdelta->delta_size;
v->weight = LONG_MAX;
@@ -311,17 +315,17 @@ pmdelta_t *_alpm_delta_parse(char *line)
}
regfree(&reg);
- CALLOC(delta, 1, sizeof(pmdelta_t), RET_ERR(PM_ERR_MEMORY, NULL));
+ CALLOC(delta, 1, sizeof(pmdelta_t), return NULL);
tmp2 = tmp;
tmp = strchr(tmp, ' ');
*(tmp++) = '\0';
- STRDUP(delta->delta, tmp2, RET_ERR(PM_ERR_MEMORY, NULL));
+ STRDUP(delta->delta, tmp2, return NULL);
tmp2 = tmp;
tmp = strchr(tmp, ' ');
*(tmp++) = '\0';
- STRDUP(delta->delta_md5, tmp2, RET_ERR(PM_ERR_MEMORY, NULL));
+ STRDUP(delta->delta_md5, tmp2, return NULL);
tmp2 = tmp;
tmp = strchr(tmp, ' ');
@@ -331,10 +335,10 @@ pmdelta_t *_alpm_delta_parse(char *line)
tmp2 = tmp;
tmp = strchr(tmp, ' ');
*(tmp++) = '\0';
- STRDUP(delta->from, tmp2, RET_ERR(PM_ERR_MEMORY, NULL));
+ STRDUP(delta->from, tmp2, return NULL);
tmp2 = tmp;
- STRDUP(delta->to, tmp2, RET_ERR(PM_ERR_MEMORY, NULL));
+ STRDUP(delta->to, tmp2, return NULL);
_alpm_log(PM_LOG_DEBUG, "delta : %s %s '%jd'\n", delta->from, delta->to, (intmax_t)delta->delta_size);