aboutsummaryrefslogtreecommitdiff
path: root/lib/http_negotiate.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/http_negotiate.c')
-rw-r--r--lib/http_negotiate.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c
index ac8ad5802..e7f934824 100644
--- a/lib/http_negotiate.c
+++ b/lib/http_negotiate.c
@@ -211,8 +211,10 @@ int Curl_input_negotiate(struct connectdata *conn, bool proxy,
}
else {
free(input_token.value);
- input_token.value = NULL;
input_token.value = malloc(mechTokenLength);
+ if (input_token.value == NULL)
+ return CURLE_OUT_OF_MEMORY;
+
memcpy(input_token.value, mechToken,mechTokenLength);
input_token.length = mechTokenLength;
free(mechToken);