- 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".
{
if (fd) {
if (--fd->nrefs > 0)
- return NULL;
+ return fd;
fd->stats = _free(fd->stats);
if (fd->digests) {
fd->digests = rpmDigestBundleFree(fd->digests);