diff options
author | Miroslav Franc <mfranc@gmx.com> | 2016-07-13 18:43:18 +0200 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2016-07-14 02:52:56 -0400 |
commit | bf430ecdef3d7c49cf01a57e3289ff7aaa1e0278 (patch) | |
tree | 23c527882f799236ae2a01cc19e73952dcd7727a /lib/socks_sspi.c | |
parent | bcc8f485e5e364deb6b5ad8502635b4358aaa277 (diff) | |
download | curl-bf430ecdef3d7c49cf01a57e3289ff7aaa1e0278.tar.gz |
library: Fix memory leaks found during static analysis
Closes https://github.com/curl/curl/pull/913
Diffstat (limited to 'lib/socks_sspi.c')
-rw-r--r-- | lib/socks_sspi.c | 4 |
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); |