Win32: fix environment memory leaks
[gitweb.git] / http.c
diff --git a/http.c b/http.c
index 3a28b219be5ecb270a6ff0422c7a4a5cdda023f0..c8cd50dd0c2b2213a86957cd4b24c03c0d85717d 100644 (file)
--- a/http.c
+++ b/http.c
@@ -1087,11 +1087,10 @@ static int update_url_from_redirect(struct strbuf *base,
        if (!strcmp(asked, got->buf))
                return 0;
 
-       if (!starts_with(asked, base->buf))
+       if (!skip_prefix(asked, base->buf, &tail))
                die("BUG: update_url_from_redirect: %s is not a superset of %s",
                    asked, base->buf);
 
-       tail = asked + base->len;
        tail_len = strlen(tail);
 
        if (got->len < tail_len ||