diff mbox

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

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

Commit Message

Jim Meyering Nov. 30, 2011, 8:51 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.
---
 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;
 	}