From 005eab0a080925d0d6f780d751f9019dafbafc64 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sun, 24 Jul 2011 13:52:05 +0200 Subject: libalpm: Set ret correctly in download_internal() Immediately jump to the cleanup code after setting the return code to -1 in case rename() fails. Otherwise, it will be reset to 0 right after we leave the if branch. Signed-off-by: Lukas Fleischer Signed-off-by: Dan McGee --- lib/libalpm/dload.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/libalpm') diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index a98d84ac..e3d30f23 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -308,6 +308,7 @@ static int download_internal(const char *url, const char *localpath, _alpm_log(PM_LOG_ERROR, _("could not rename %s to %s (%s)\n"), tempfile, destfile, strerror(errno)); ret = -1; + goto cleanup; } ret = 0; -- cgit v1.2.3-24-g4f1b