summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-08-17 11:30:43 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-10-03 10:13:51 +0300
commitec3e946098f779ce7805b1929c4378ba0f7a12c2 (patch)
treeb87f4813a5e304d45dec607eb44a138e09c71cc9
parent2914ce01852466fe62bf6f562e9ab119e77a20c4 (diff)
downloadrpm-ec3e946098f779ce7805b1929c4378ba0f7a12c2.tar.gz
Revert "Always return NULL from fdFree()"
- This reverts commit 4c1f7e335de1724661ce63c53186d161ab71a63f: various things inside and outside of rpm actually do still depend on the old behavior, and leak file descriptors otherwise. As an easy backportable band-aid, revert back to the previous behavior, to which various callers are tuned to fix the regression introduced in rpm 4.10.0. The real fix would be something more like "eliminate fdFree() and make Fclose() honor refcounts". (cherry picked from commit 429b933b42d1821f6f0a2a41ae13c504ea6d0657)
-rw-r--r--rpmio/rpmio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c
index 3d584511f..6feae8633 100644
--- a/rpmio/rpmio.c
+++ b/rpmio/rpmio.c
@@ -353,7 +353,7 @@ FD_t fdFree( FD_t fd)
{
if (fd) {
if (--fd->nrefs > 0)
- return NULL;
+ return fd;
fd->stats = _free(fd->stats);
if (fd->digests) {
fd->digests = rpmDigestBundleFree(fd->digests);