From 86679b599f53df2659f8d3b0e2b740c2ce80c4a6 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 29 Apr 2008 17:38:21 +0300 Subject: [PATCH] Plug a memleak in lzclose() --- rpmio/rpmio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index 9b34041..3325e88 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -2639,7 +2639,7 @@ static int lzflush(LZFILE *lzfile) static int lzclose(LZFILE *lzfile) { lzma_ret ret; - int n; + int n, rc; if (!lzfile) return -1; @@ -2658,8 +2658,9 @@ static int lzclose(LZFILE *lzfile) } } lzma_end(&lzfile->strm); - return fclose(lzfile->file); + rc = fclose(lzfile->file); free(lzfile); + return rc; } static ssize_t lzread(LZFILE *lzfile, void *buf, size_t len)