Skip to contentSkip to conversation

lookup_ldap.c: no need to free a result that is NULL

PATCH New Jeff Moyer 1 participant 1 message Sep 4, 2009

Subsystems (2)
lore
Share & tools
lore

Jeff Moyer

author
#0 lore raw

PATCH 1/1 lookup_ldap.c: no need to free a result that is NULL

Hi, Ian,

Here's another trivial patch. If we already know the result pointer is null, there's no need to call ldap_msgfree on it!

Cheers,
Jeff

Makefile.rules +1 -1
index f2ba386..26da6d8 100644
@@ -38,7 +38,7 @@ STRIP     = strip --strip-debug
 endif
 endif
 
-CC        = gcc
+# CC        = gcc
 CXX       = g++
 CXXFLAGS  = $(CFLAGS)
 LD        = ld
modules/lookup_ldap.c +0 -1
index 3a31a8e..d0cbdca 100644
@@ -400,7 +400,6 @@ static int get_query_dn(unsigned logopt, LDAP *ldap, struct lookup_context *ctxt
 		}
 
 		if (!result) {
-			ldap_msgfree(result);
 			error(logopt,
 			      MODPREFIX "failed to find query dn under search base dns");
 			free(query);