ldap/servers/slapd/back-ldbm/ldbm_delete.c | 1 + ldap/servers/slapd/ldaputil.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
New commits: commit a0d2d529ad83b90367fba52e7a13e03803a9b3d1 Author: Mark Reynolds mreynolds@redhat.com Date: Tue Oct 8 10:21:34 2013 -0400
Ticket 47517 - fix memory leaks in ldaputil.c nad ldbm_delete.c
Fixed leak when getting the hostname control in ldaputil.c, and a leak in ldbm_delete.c and the hte parent id string.
https://fedorahosted.org/389/ticket/47517
Reviewed by: nhosoi & richm(Thanks!)
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c index 9d84cb1..c5ecd7f 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c @@ -456,6 +456,7 @@ ldbm_back_delete( Slapi_PBlock *pb ) * and numsubordinate count could get confused. */ ID pid = (ID)strtol(pid_str, (char **)NULL, 10); + slapi_ch_free_string(&pid_str); parent = id2entry(be, pid ,NULL, &retval); if (parent && cache_lock_entry(&inst->inst_cache, parent)) { /* Failed to obtain parent entry's entry lock */ diff --git a/ldap/servers/slapd/ldaputil.c b/ldap/servers/slapd/ldaputil.c index edef006..8e6ec8b 100644 --- a/ldap/servers/slapd/ldaputil.c +++ b/ldap/servers/slapd/ldaputil.c @@ -1096,6 +1096,7 @@ slapi_ldap_bind( if (ptr) { copy = slapi_ch_strdup(myhostname); *(copy + (ptr - myhostname)) = '\0'; + slapi_ch_free_string(&myhostname); myhostname = copy; } } @@ -1118,7 +1119,7 @@ slapi_ldap_bind( myerrno ? myerrno : gaierr, myerrno ? slapd_system_strerror(myerrno) : gai_strerror(gaierr), myhostname ? myhostname : "unknown host"); - slapi_ch_free_string(©); + slapi_ch_free_string(&myhostname); goto done; }
389-commits@lists.fedoraproject.org