ports/95341: [PATCH] Plug another memory leak in net/py-ldap2

Xin LI delphij at FreeBSD.org
Wed Apr 5 09:00:46 UTC 2006


>Number:         95341
>Category:       ports
>Synopsis:       [PATCH] Plug another memory leak in net/py-ldap2
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 05 09:00:23 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Xin LI
>Release:        FreeBSD 6.1-PRERELEASE i386
>Organization:
The FreeBSD Simplified Chinese Project
>Environment:
System: FreeBSD tarsier.delphij.net 6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #24: Sun Apr 2 23:48:06 CST 2006 delphij at tarsier.delphij.net:/usr/obj/usr/src/sys/TARSIER i386


>Description:
	The proposed patch corrects another two memory leaks in
net/py-ldap2, which was already accepted by python-ldap.  Note
that this issue exists in previous versions as well.
>How-To-Repeat:
	Use python-ldap to query non-existent LDAP entry
repeatedly.
>Fix:

--- patch-py-ldap2 begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/net/py-ldap2/Makefile,v
retrieving revision 1.32
diff -u -r1.32 Makefile
--- Makefile	5 Apr 2006 07:57:56 -0000	1.32
+++ Makefile	5 Apr 2006 08:48:19 -0000
@@ -6,6 +6,7 @@
 
 PORTNAME=	ldap2
 PORTVERSION=	2.0.11
+PORTREVISION=	1
 CATEGORIES=	net
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	python-ldap
Index: files/patch-Modules-LDAPObject.c
===================================================================
RCS file: /home/ncvs/ports/net/py-ldap2/files/patch-Modules-LDAPObject.c,v
retrieving revision 1.1
diff -u -r1.1 patch-Modules-LDAPObject.c
--- files/patch-Modules-LDAPObject.c	5 Apr 2006 07:57:56 -0000	1.1
+++ files/patch-Modules-LDAPObject.c	4 Apr 2006 10:49:27 -0000
@@ -1,11 +1,26 @@
 Index: LDAPObject.c
 ===================================================================
 RCS file: /cvsroot/python-ldap/python-ldap/Modules/LDAPObject.c,v
-retrieving revision 1.72
-diff -u -r1.72 LDAPObject.c
---- Modules/LDAPObject.c	11 Mar 2006 21:05:57 -0000	1.72
-+++ Modules/LDAPObject.c	23 Mar 2006 21:48:33 -0000
-@@ -971,8 +971,16 @@
+retrieving revision 1.71
+diff -u -r1.71 LDAPObject.c
+--- Modules/LDAPObject.c	30 Nov 2005 21:04:09 -0000	1.71
++++ Modules/LDAPObject.c	4 Apr 2006 10:45:18 -0000
+@@ -953,12 +953,14 @@
+ 		e = err;
+ 	    } else
+ 		e = "ldap_parse_result";
++	    ldap_msgfree(msg);
+ 	    return LDAPerror( self->ldap, e );
+ 	}
+ 
+         if (!(pyctrls = LDAPControls_to_List(serverctrls))) {
+             int err = LDAP_NO_MEMORY;
+             ldap_set_option(self->ldap, LDAP_OPT_ERROR_NUMBER, &err);
++	    ldap_msgfree(msg);
+             return LDAPerror(self->ldap, "LDAPControls_to_List");
+         }
+         ldap_controls_free(serverctrls);
+@@ -971,8 +973,16 @@
      if (pmsg == NULL) {
  	    retval = NULL;
      } else {
--- patch-py-ldap2 ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list