diff mbox

[5/9] mount: don't leak upon LDAP parse failure

Message ID 1322755106-8171-6-git-send-email-jim@meyering.net
State Superseded
Headers show

Commit Message

Jim Meyering Dec. 1, 2011, 3:58 p.m. UTC
From: Jim Meyering <meyering@redhat.com>

* src/libnsdb/fileserver.c (nsdb_resolve_fsn_parse_entry): When we
fail to parse an LDAP entry, free just-allocated new->fl_dn and new.
Spotted by coverity.

Signed-off-by: Jim Meyering <meyering@redhat.com>
---
 src/libnsdb/fileserver.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/src/libnsdb/fileserver.c b/src/libnsdb/fileserver.c
index a7631e8..b22d83f 100644
--- a/src/libnsdb/fileserver.c
+++ b/src/libnsdb/fileserver.c
@@ -781,6 +781,8 @@  nsdb_resolve_fsn_parse_entry(LDAP *ld, LDAPMessage *entry,
 	if (retval != FEDFS_OK) {
 		xlog(D_CALL, "%s: parsing failed: %s",
 			__func__, nsdb_display_fedfsstatus(retval));
+		free(new->fl_dn);
+		free(new);
 		return retval;
 	}