summaryrefslogtreecommitdiffstats
path: root/lib/vauth/ntlm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vauth/ntlm.c')
-rw-r--r--lib/vauth/ntlm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c
index ed7cee8..018e6a6 100644
--- a/lib/vauth/ntlm.c
+++ b/lib/vauth/ntlm.c
@@ -44,6 +44,7 @@
#include "warnless.h"
#include "rand.h"
#include "vtls/vtls.h"
+#include "strdup.h"
#define BUILDING_CURL_NTLM_MSGS_C
#include "vauth/vauth.h"
@@ -184,11 +185,10 @@ static CURLcode ntlm_decode_type2_target(struct Curl_easy *data,
}
free(ntlm->target_info); /* replace any previous data */
- ntlm->target_info = malloc(target_info_len);
+ ntlm->target_info = Curl_memdup(&type2[target_info_offset],
+ target_info_len);
if(!ntlm->target_info)
return CURLE_OUT_OF_MEMORY;
-
- memcpy(ntlm->target_info, &type2[target_info_offset], target_info_len);
}
}