diff --git a/source/src/client.cpp b/source/src/client.cpp index 871832e5..15ac2307 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -1156,9 +1156,9 @@ bool requirepackage(int type, const char *path) loopv(pckservers) if(pckservers[i]->responsive) { source = pckservers[i]; break; } if(!source) { conoutf("\f3no responsive source server found, can't download"); return false; } - char *cleanpath = unixpath(newstring(path)); + char *upath = unixpath(newstring(path)), *cleanpath = newstring(path); filtertext(cleanpath, cleanpath, FTXT__MEDIAFILEPATH); - if(strcmp(path, cleanpath)) { conoutf("refuse to download \"%s\": illegal characters", path); delstring(cleanpath); return false; } + if(strcmp(upath, cleanpath)) { conoutf("refuse to download \"%s\": illegal characters", path); delstring(upath); delstring(cleanpath); return false; } if(!havecurl || canceldownloads || type < 0 || type >= PCK_NUM || pendingpackages.access(cleanpath)) { delstring(cleanpath); return false; } package *pck = new package; @@ -1167,6 +1167,7 @@ bool requirepackage(int type, const char *path) pck->source = source; pck->pending = true; pendingpackages.access(pck->name, pck); + delstring(upath); return true; }