From 4c1f7e335de1724661ce63c53186d161ab71a63f Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 18 Apr 2012 10:09:01 +0300 Subject: [PATCH] Always return NULL from fdFree() - Up to now, if the fd had remaining references fdFree() would return the supposedly free'd fd back to us, which is unlike anything else in rpm. Make this consistent with the rest of rpm finally as the last remaining caller requiring the old semantics is gone from the codebase (somewhere between 4.9 and 4.10): always return NULL, as the referenced instance is now gone as far as the caller is concerned. --- rpmio/rpmio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index 6feae86..3d58451 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 fd; + return NULL; fd->stats = _free(fd->stats); if (fd->digests) { fd->digests = rpmDigestBundleFree(fd->digests); -- 2.7.4