Revert "Update to 7.44.0"
[platform/upstream/curl.git] / lib / smb.c
index d461a71..3fadecd 100644 (file)
--- a/lib/smb.c
+++ b/lib/smb.c
 #include "transfer.h"
 #include "vtls/vtls.h"
 #include "curl_ntlm_core.h"
+#include "curl_memory.h"
 #include "escape.h"
 #include "curl_endian.h"
 
-/* The last #include files should be: */
-#include "curl_memory.h"
+/* The last #include file should be: */
 #include "memdebug.h"
 
 /* Local API functions */
@@ -941,7 +941,7 @@ static CURLcode smb_parse_url_path(struct connectdata *conn)
   /* Parse the path for the share */
   req->share = strdup((*path == '/' || *path == '\\') ? path + 1 : path);
   if(!req->share) {
-    free(path);
+    Curl_safefree(path);
 
     return CURLE_OUT_OF_MEMORY;
   }
@@ -952,7 +952,7 @@ static CURLcode smb_parse_url_path(struct connectdata *conn)
 
   /* The share must be present */
   if(!slash) {
-    free(path);
+    Curl_safefree(path);
 
     return CURLE_URL_MALFORMAT;
   }
@@ -966,7 +966,7 @@ static CURLcode smb_parse_url_path(struct connectdata *conn)
       *slash = '\\';
   }
 
-  free(path);
+  Curl_safefree(path);
 
   return CURLE_OK;
 }