http-fetch: do not use curl_message after releasing it
[gitweb.git] / sha1_file.c
index 642f00d3d47c3d782c3dfe522d21819c1a67de30..946a35346bdaf21432b7f463712f5bf8881fee39 100644 (file)
@@ -51,6 +51,8 @@ int get_sha1_hex(const char *hex, unsigned char *sha1)
 int safe_create_leading_directories(char *path)
 {
        char *pos = path;
+       if (*pos == '/')
+               pos++;
 
        while (pos) {
                pos = strchr(pos, '/');