diff options
author | Michen Chang <Michen.Chang@Sun.COM> | 2010-03-27 12:27:01 -0700 |
---|---|---|
committer | Michen Chang <Michen.Chang@Sun.COM> | 2010-03-27 12:27:01 -0700 |
commit | e84b06c37938f78f92152e488295ec2634d8ebca (patch) | |
tree | af1330cd9e4486167ce9910db3ff158fe6e9efec /usr/src/lib/libsldap | |
parent | 80cb75f4d9571f1433193b5cd8cc7d22469e0848 (diff) | |
download | illumos-joyent-e84b06c37938f78f92152e488295ec2634d8ebca.tar.gz |
6611693 lidsldap: memory leak in __s_api_sasl_bind_callback()
6551734 libsldap: memory leak in __ns_ldap_getParam()
Diffstat (limited to 'usr/src/lib/libsldap')
-rw-r--r-- | usr/src/lib/libsldap/common/ns_reads.c | 6 | ||||
-rw-r--r-- | usr/src/lib/libsldap/common/ns_sasl.c | 15 |
2 files changed, 11 insertions, 10 deletions
diff --git a/usr/src/lib/libsldap/common/ns_reads.c b/usr/src/lib/libsldap/common/ns_reads.c index 103bf9ce2c..cda5b344fe 100644 --- a/usr/src/lib/libsldap/common/ns_reads.c +++ b/usr/src/lib/libsldap/common/ns_reads.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -2960,7 +2960,7 @@ ldap_list( /* get the service descriptor - or create a default one */ rc = __s_api_get_SSD_from_SSDtoUse_service(service, - &sdlist, errorp); + &sdlist, &error); if (rc != NS_LDAP_SUCCESS) { delete_search_cookie(cookie); *errorp = error; @@ -3563,7 +3563,7 @@ firstEntry( /* get the service descriptor - or create a default one */ rc = __s_api_get_SSD_from_SSDtoUse_service(service, - &sdlist, errorp); + &sdlist, &error); if (rc != NS_LDAP_SUCCESS) { *errorp = error; return (rc); diff --git a/usr/src/lib/libsldap/common/ns_sasl.c b/usr/src/lib/libsldap/common/ns_sasl.c index 2aa5f0c9f9..0c1c458686 100644 --- a/usr/src/lib/libsldap/common/ns_sasl.c +++ b/usr/src/lib/libsldap/common/ns_sasl.c @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <stdlib.h> #include <strings.h> @@ -265,10 +263,13 @@ __s_api_sasl_bind_callback( } if (ret) { - interact->result = strdup(ret); - if (interact->result == NULL) - return (LDAP_NO_MEMORY); - + /* + * No need to do strdup(ret), the data is always + * available in 'defaults' and libldap won't + * free it either. strdup(ret) causes memory + * leak. + */ + interact->result = ret; interact->len = strlen(ret); } else { interact->result = NULL; |