summaryrefslogtreecommitdiff
path: root/lib/ldap.c
diff options
context:
space:
mode:
authorGisle Vanem <gvanem@broadpark.no>2005-02-09 14:28:35 +0000
committerGisle Vanem <gvanem@broadpark.no>2005-02-09 14:28:35 +0000
commit32d76a5b57eec2142be5e773c59f9a2e8cfb273e (patch)
treebf9c26d3e41f7e872b60f2bdc3a08508b80ebdde /lib/ldap.c
parent14aa3fa25844e74e88e74af013ad739c6786e787 (diff)
downloadcurl-32d76a5b57eec2142be5e773c59f9a2e8cfb273e.tar.gz
Set 'bits.close' in case of malloc fail.
Don't free 'lud_dn' twice in case curl_unescape() fails.
Diffstat (limited to 'lib/ldap.c')
-rw-r--r--lib/ldap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ldap.c b/lib/ldap.c
index 3afa81352..15c19b377 100644
--- a/lib/ldap.c
+++ b/lib/ldap.c
@@ -380,6 +380,7 @@ quit:
/* no data to transfer */
Curl_Transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
+ conn->bits.close = TRUE;
return status;
}
@@ -474,9 +475,9 @@ static bool unescape_elements (LDAPURLDesc *ludp)
char *new_dn = curl_unescape(dn, 0);
free(dn);
+ ludp->lud_dn = new_dn;
if (!new_dn)
return (FALSE);
- ludp->lud_dn = new_dn;
}
return (TRUE);
}