diff options
Diffstat (limited to 'rpmmodule/rpmmodule.c')
-rw-r--r-- | rpmmodule/rpmmodule.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/rpmmodule/rpmmodule.c b/rpmmodule/rpmmodule.c index 6b8d8a463..5578483b2 100644 --- a/rpmmodule/rpmmodule.c +++ b/rpmmodule/rpmmodule.c @@ -910,7 +910,7 @@ static void * tsCallback(const Header h, const rpmCallbackType what, struct tsCallbackType * cbInfo = data; PyObject * args, * result; int fd; - FD_t fdt; + static FD_t fdt; if (cbInfo->pythonError) return NULL; @@ -931,11 +931,14 @@ static void * tsCallback(const Header h, const rpmCallbackType what, return NULL; } fdt = fdDup(fd); - close(fd); Py_DECREF(result); return fdt; } + if (what == RPMCALLBACK_INST_CLOSE_FILE) { + fdClose (fdt); + } + Py_DECREF(result); return NULL; |