diff options
author | Yang Tse <yangsita@gmail.com> | 2010-06-02 12:44:46 +0200 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2010-06-02 12:44:46 +0200 |
commit | 69d07feb145bd4e34c5740946ea0ef405f98f628 (patch) | |
tree | bb9cb0923a96355604db7c8657ef7210663c7626 | |
parent | 1c4538610b4e69b7a365c9db9421182496eef9bd (diff) |
fix spnego memory leak
-rw-r--r-- | lib/http_negotiate.c | 8 |
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); |