From b7e71a249edf3c3215413ed75269d27f86a9e5a5 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Tue, 14 Oct 2008 09:12:44 +0000
Subject: [PATCH] eeek, append 1 on the right place as otherwise we didn't fix
 the problem

---
 src/urlglob.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/urlglob.c b/src/urlglob.c
index b133fb0e8b..5f9a3e5e65 100644
--- a/src/urlglob.c
+++ b/src/urlglob.c
@@ -551,8 +551,8 @@ char *glob_match_url(char *filename, URLGlob *glob)
       char *newstr;
       /* we append a single byte to allow for the trailing byte to be appended
          at the end of this function outside the while() loop */
-      allocsize = (appendlen + stringlen)*2 + 1;
-      newstr=realloc(target, allocsize);
+      allocsize = (appendlen + stringlen)*2;
+      newstr=realloc(target, allocsize + 1);
       if(NULL ==newstr) {
         free(target);
         return NULL;
-- 
GitLab