From db70c9da153c4767bfd96a15d40e086184bd5402 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Wed, 7 Sep 2011 22:22:25 -0400 Subject: [PATCH] diskspace: fix memory leak on root mount not found Signed-off-by: Dave Reisner Signed-off-by: Dan McGee --- lib/libalpm/diskspace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index df414ab9..fe2036d5 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -251,7 +251,8 @@ int _alpm_check_diskspace(alpm_handle_t *handle) if(root_mp == NULL) { _alpm_log(handle, ALPM_LOG_ERROR, _("could not determine root mount point %s\n"), handle->root); - return -1; + error = 1; + goto finish; } replaces = alpm_list_count(trans->remove); @@ -319,6 +320,7 @@ int _alpm_check_diskspace(alpm_handle_t *handle) } } +finish: for(i = mount_points; i; i = i->next) { alpm_mountpoint_t *data = i->data; FREE(data->mount_dir);