From patchwork Mon Dec 5 17:24:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [7/9] libnsdb: don't leak a read buffer upon certfile open failure Date: Mon, 05 Dec 2011 07:24:04 -0000 From: Chuck Lever X-Patchwork-Id: 129380 Message-Id: <20111205172404.7753.1340.stgit@degas.1015granger.net> To: fedfs-utils-devel@oss.oracle.com From: Jim Meyering * src/libnsdb/nsdb.c (nsdb_read_certfile): Free "buf" also on the failed-open path. Spotted by coverity. Introduced by commit 0520ee72: "Initial commit," (March 29, 2011). Signed-off-by: Jim Meyering --- src/libnsdb/nsdb.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/libnsdb/nsdb.c b/src/libnsdb/nsdb.c index c81f228..02c0588 100644 --- a/src/libnsdb/nsdb.c +++ b/src/libnsdb/nsdb.c @@ -524,6 +524,7 @@ nsdb_read_certfile(const char *pathname, char **certdata, if (fd == -1) { xlog(D_GENERAL, "%s: Failed to open %s: %m", __func__, pathname); + free(buf); goto out; }