Bug 4267 - Memory leaks in ldapsam_modify_entry(..)
Summary: Memory leaks in ldapsam_modify_entry(..)
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: User/Group Accounts (show other bugs)
Version: 3.0.23d
Hardware: All Windows XP
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-28 19:04 UTC by David
Modified: 2006-11-29 00:15 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David 2006-11-28 19:04:40 UTC
The following is the patch to resolve mem leaks in ldapsam_modify_entry(..) in pdb_ldap.c.  (3.0.23d)

--- pdb_ldap.c  2006-11-14 06:42:14.000000000 -0800
+++ pdb_ldap.c.new      2006-11-28 16:52:09.980061000 -0800
@@ -1592,12 +1592,14 @@
                }

                if (push_utf8_allocate(&utf8_dn, dn) == (size_t)-1) {
+                       SAFE_FREE(utf8_password);
                        return NT_STATUS_NO_MEMORY;
                }

                if ((ber = ber_alloc_t(LBER_USE_DER))==NULL) {
                        DEBUG(0,("ber_alloc_t returns NULL\n"));
                        SAFE_FREE(utf8_password);
+                       SAFE_FREE(utf8_dn);
                        return NT_STATUS_UNSUCCESSFUL;
                }
Comment 1 Volker Lendecke 2006-11-29 00:15:55 UTC
Fixed with r19943 -- thanks.

Volker