From 2bc2b430bc4c1a9a0bfd1c01da68bd53bf7da052 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Sun, 10 Sep 2023 03:05:12 +0000 Subject: automatic import of rpm --- ...eleak-when-urlGetFile-fails-in-rpmInstall.patch | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 backport-Fix-fileleak-when-urlGetFile-fails-in-rpmInstall.patch (limited to 'backport-Fix-fileleak-when-urlGetFile-fails-in-rpmInstall.patch') diff --git a/backport-Fix-fileleak-when-urlGetFile-fails-in-rpmInstall.patch b/backport-Fix-fileleak-when-urlGetFile-fails-in-rpmInstall.patch new file mode 100644 index 0000000..7b5bb6e --- /dev/null +++ b/backport-Fix-fileleak-when-urlGetFile-fails-in-rpmInstall.patch @@ -0,0 +1,30 @@ +From af81c95114bc2c01f005f15f17646a5188b5855d Mon Sep 17 00:00:00 2001 +From: xujing +Date: Mon, 28 Nov 2022 11:34:24 +0800 +Subject: [PATCH 3/3] Fix fileleak when urlGetFile fails in rpmInstall + +The "tfn" is created by calling rpmMkTempFile but not unlinked when +urlGetFile fails in rpmInstall. Fix it. +--- + lib/rpminstall.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/lib/rpminstall.c b/lib/rpminstall.c +index 90474fabf..c89ca30b5 100644 +--- a/lib/rpminstall.c ++++ b/lib/rpminstall.c +@@ -520,7 +520,10 @@ restart: + _("skipping %s - transfer failed\n"), fileURL); + eiu->numFailed++; + eiu->pkgURL[eiu->pkgx] = NULL; +- tfn = _free(tfn); ++ if (tfn) { ++ (void) unlink(tfn); ++ tfn = _free(tfn); ++ } + break; + } + eiu->pkgState[eiu->pkgx] = 1; +-- +2.27.0 + -- cgit v1.2.3