summaryrefslogtreecommitdiff
path: root/usr/src/lib/libsldap/common/ns_connect.c
diff options
context:
space:
mode:
authorHans Rosenfeld <hans.rosenfeld@nexenta.com>2012-10-18 12:22:08 -0500
committerRichard Lowe <richlowe@richlowe.net>2012-10-22 21:12:57 -0400
commitb3b48d8e61fb04617f1a22d673c555b155f02e64 (patch)
treed6870cecc6a37c6c19148462be76d5564b29169b /usr/src/lib/libsldap/common/ns_connect.c
parent2d4be7aab5a43b4b2bf4e1b527dcddb9bff39ee6 (diff)
downloadillumos-gate-b3b48d8e61fb04617f1a22d673c555b155f02e64.tar.gz
3285 memory leaks in libsldap
Reviewed by: Gordon Ross <Gordon.Ross@nexenta.com> Reviewed by: Dan McDonald <danmcd@nexenta.com> Reviewed by: Kevin Crowe <kevin.crowe@nexenta.com> Reviewed by: Vitaliy Gusev <vitaliy.gusev@nexenta.com> Reviewed by: Richard Lowe <richlowe@richlowe.net> Reviewed by: Garrett D'Amore <garrett@damore.org> Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/lib/libsldap/common/ns_connect.c')
-rw-r--r--usr/src/lib/libsldap/common/ns_connect.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr/src/lib/libsldap/common/ns_connect.c b/usr/src/lib/libsldap/common/ns_connect.c
index 68387eaa52..a8a03c16b1 100644
--- a/usr/src/lib/libsldap/common/ns_connect.c
+++ b/usr/src/lib/libsldap/common/ns_connect.c
@@ -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 <stdlib.h>
@@ -475,10 +476,10 @@ printCred(FILE *fp, const ns_cred_t *cred)
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 @@ makeConnection(Connection **conp, const char *serverAddr,
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));