# HG changeset patch # User Hans Rosenfeld # Date 1350580928 18000 # Node ID 6fa12cf47ebbd481e5c450cfe40c3b2a3ea573f4 # Parent 2737b2ab1b9e95c6ca4b521d60198647d0671c18 3285 memory leaks in libsldap Reviewed by: Gordon Ross Reviewed by: Dan McDonald Reviewed by: Kevin Crowe Reviewed by: Vitaliy Gusev Reviewed by: Richard Lowe Reviewed by: Garrett D'Amore Approved by: Richard Lowe diff -r 2737b2ab1b9e -r 6fa12cf47ebb usr/src/lib/libsldap/common/ns_connect.c --- a/usr/src/lib/libsldap/common/ns_connect.c Fri Sep 07 23:51:24 2012 -0400 +++ b/usr/src/lib/libsldap/common/ns_connect.c Thu Oct 18 12:22:08 2012 -0500 @@ -21,6 +21,7 @@ /* * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ #include @@ -475,10 +476,10 @@ return; } - (void) fprintf(fp, "tid= %d: AuthType=%d", t, cred->auth.type); - (void) fprintf(fp, "tid= %d: TlsType=%d", t, cred->auth.tlstype); - (void) fprintf(fp, "tid= %d: SaslMech=%d", t, cred->auth.saslmech); - (void) fprintf(fp, "tid= %d: SaslOpt=%d", t, cred->auth.saslopt); + (void) fprintf(fp, "tid= %d: AuthType=%d\n", t, cred->auth.type); + (void) fprintf(fp, "tid= %d: TlsType=%d\n", t, cred->auth.tlstype); + (void) fprintf(fp, "tid= %d: SaslMech=%d\n", t, cred->auth.saslmech); + (void) fprintf(fp, "tid= %d: SaslOpt=%d\n", t, cred->auth.saslopt); if (cred->hostcertpath) (void) fprintf(fp, "tid= %d: hostCertPath=%s\n", t, cred->hostcertpath); @@ -701,7 +702,8 @@ if (conp == NULL || errorp == NULL || auth == NULL) return (NS_LDAP_INVALID_PARAM); - *errorp = NULL; + if (*errorp) + (void) __ns_ldap_freeError(errorp); *conp = NULL; (void) memset(&sinfo, 0, sizeof (sinfo)); diff -r 2737b2ab1b9e -r 6fa12cf47ebb usr/src/lib/libsldap/common/ns_standalone.c --- a/usr/src/lib/libsldap/common/ns_standalone.c Fri Sep 07 23:51:24 2012 -0400 +++ b/usr/src/lib/libsldap/common/ns_standalone.c Thu Oct 18 12:22:08 2012 -0500 @@ -22,6 +22,7 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * Copyright 2012 Milan Jurik. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ #define __STANDALONE_MODULE__ @@ -1450,6 +1451,7 @@ } __s_api_conn_user_free(cu); + DropConnection(sessionId, NS_LDAP_NEW_CONN); return (NS_LDAP_OP_FAILED); } __s_api_conn_user_free(cu);