aboutsummaryrefslogtreecommitdiff
path: root/lib/socks_sspi.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/socks_sspi.c')
-rw-r--r--lib/socks_sspi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/socks_sspi.c b/lib/socks_sspi.c
index 7fbf3dfee..605349038 100644
--- a/lib/socks_sspi.c
+++ b/lib/socks_sspi.c
@@ -34,6 +34,7 @@
#include "curl_sspi.h"
#include "curl_multibyte.h"
#include "warnless.h"
+#include "strdup.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
#include "curl_memory.h"
@@ -96,10 +97,9 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
/* prepare service name */
if(strchr(service, '/')) {
- service_name = malloc(strlen(service));
+ service_name = strdup(service);
if(!service_name)
return CURLE_OUT_OF_MEMORY;
- memcpy(service_name, service, strlen(service));
}
else {
service_name = malloc(strlen(service) + strlen(conn->proxy.name) + 2);