aboutsummaryrefslogtreecommitdiff
path: root/lib/http_negotiate.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-06-02 12:44:46 +0200
committerYang Tse <yangsita@gmail.com>2010-06-02 12:44:46 +0200
commit69d07feb145bd4e34c5740946ea0ef405f98f628 (patch)
treebb9cb0923a96355604db7c8657ef7210663c7626 /lib/http_negotiate.c
parent1c4538610b4e69b7a365c9db9421182496eef9bd (diff)
fix spnego memory leak
Diffstat (limited to 'lib/http_negotiate.c')
-rw-r--r--lib/http_negotiate.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c
index d51d45631..ab1296e5b 100644
--- a/lib/http_negotiate.c
+++ b/lib/http_negotiate.c
@@ -305,11 +305,15 @@ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
infof(conn->data, "Make SPNEGO Initial Token failed\n");
}
else {
- free(neg_ctx->output_token.value);
+ free(responseToken);
responseToken = NULL;
+ free(neg_ctx->output_token.value);
neg_ctx->output_token.value = malloc(spnegoTokenLength);
- if(neg_ctx->output_token.value == NULL)
+ if(neg_ctx->output_token.value == NULL) {
+ free(spnegoToken);
+ spnegoToken = NULL;
return CURLE_OUT_OF_MEMORY;
+ }
memcpy(neg_ctx->output_token.value, spnegoToken,spnegoTokenLength);
neg_ctx->output_token.length = spnegoTokenLength;
free(spnegoToken);