Patchwork [8/9] libnsdb: Use ber_memfree(3) where needed

login
register
mail settings
Submitter Chuck Lever
Date Oct. 29, 2012, 5:35 p.m.
Message ID <20121029173539.53098.7948.stgit@seurat.1015granger.net>
Download mbox | patch
Permalink /patch/195088/
State Accepted
Headers show

Comments

Chuck Lever - Oct. 29, 2012, 5:35 p.m.
In nsdb_construct_fsl_dn(), ber_memalloc(3) is used to allocate
some memory.  ber_memfree(3) should be used to release it.  This
oversight is probably harmless, because ber_memfree(3) is typically
a simple wrapper around free(3).

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 src/libnsdb/administrator.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/src/libnsdb/administrator.c b/src/libnsdb/administrator.c
index 23f38d9..1b46360 100644
--- a/src/libnsdb/administrator.c
+++ b/src/libnsdb/administrator.c
@@ -498,7 +498,7 @@  nsdb_construct_fsl_dn(const char *nce, const char *fsn_uuid, const char *fsl_uui
 				fsl_uuid, fsn_uuid, nce);
 	if (len < 0 || (size_t)len > dn_len) {
 		xlog(D_GENERAL, "%s: DN is too long", __func__);
-		free(dn);
+		ber_memfree(dn);
 		return NULL;
 	}