mirror of
https://github.com/curl/curl.git
synced 2026-04-17 07:51:41 +03:00
fix spnego memory leak
This commit is contained in:
parent
1c4538610b
commit
69d07feb14
1 changed files with 6 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue