From patchwork Tue Dec 13 22:51:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [07/12] libsi: don't leak a struct srvinfo upon failed strdup Date: Tue, 13 Dec 2011 12:51:59 -0000 From: Chuck Lever X-Patchwork-Id: 131207 Message-Id: <20111213225159.15402.3758.stgit@degas.1015granger.net> To: fedfs-utils-devel@oss.oracle.com From: Jim Meyering * src/libsi/getsrvinfo.c (getsrvinfo): Free "new". Spotted by coverity. Introduced in commit 0520ee72: "Initial commit," (March 29, 2011). Signed-off-by: Jim Meyering --- src/libsi/getsrvinfo.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/libsi/getsrvinfo.c b/src/libsi/getsrvinfo.c index 7a465c7..931847e 100644 --- a/src/libsi/getsrvinfo.c +++ b/src/libsi/getsrvinfo.c @@ -289,6 +289,7 @@ getsrvinfo(const char *srvname, const char *domainname, struct srvinfo **si) new->si_target = strdup(exp_dn); if (new->si_target == NULL) { + free(new); status = ESI_MEMORY; goto out; }