diff options
author | rm88369 <none@none> | 2007-03-05 02:22:57 -0800 |
---|---|---|
committer | rm88369 <none@none> | 2007-03-05 02:22:57 -0800 |
commit | 36cd58d39f442becc413d6977a119161133f3d5d (patch) | |
tree | e15a218092c02952b0a38489229982e89d03107c /usr | |
parent | 8365e7c9222c4c8080dc66e31c58032c59b1c199 (diff) | |
download | illumos-gate-36cd58d39f442becc413d6977a119161133f3d5d.tar.gz |
6500684 memory leak in libsldap:setup_next_search()
Diffstat (limited to 'usr')
-rw-r--r-- | usr/src/lib/libsldap/common/ns_reads.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/usr/src/lib/libsldap/common/ns_reads.c b/usr/src/lib/libsldap/common/ns_reads.c index fa4745c7cd..404f0ec182 100644 --- a/usr/src/lib/libsldap/common/ns_reads.c +++ b/usr/src/lib/libsldap/common/ns_reads.c @@ -1459,6 +1459,8 @@ setup_next_search(ns_ldap_cookie_t *cookie) cookie->err_rc = NS_LDAP_INVALID_PARAM; return (-1); } else { + if (cookie->filter) + free(cookie->filter); cookie->filter = strdup(cookie->i_filter); if (cookie->filter == NULL) { cookie->err_rc = NS_LDAP_MEMORY; @@ -1466,6 +1468,8 @@ setup_next_search(ns_ldap_cookie_t *cookie) } } } else { + if (cookie->filter) + free(cookie->filter); cookie->filter = strdup(filter); free(filter); if (cookie->filter == NULL) { @@ -1517,6 +1521,8 @@ setup_next_search(ns_ldap_cookie_t *cookie) } str = ((char **)param)[0]; baselen += strlen(str)+1; + if (cookie->basedn) + free(cookie->basedn); cookie->basedn = (char *)malloc(baselen); if (cookie->basedn == NULL) { cookie->err_rc = NS_LDAP_MEMORY; @@ -1526,6 +1532,8 @@ setup_next_search(ns_ldap_cookie_t *cookie) (void) strcat(cookie->basedn, str); (void) __ns_ldap_freeParam(¶m); } else { + if (cookie->basedn) + free(cookie->basedn); cookie->basedn = strdup(dptr->basedn); } return (0); |