aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/urlglob.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/urlglob.c b/src/urlglob.c
index b133fb0e8..5f9a3e5e6 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;