* src/res.c (add_path): Fix memleak (parsing robots.txt)

Fixes OSS-Fuzz issue #8005.
This is a long standing bug affecting all versions <= 1.19.4.
This commit is contained in:
Tim Rühsen 2018-04-25 11:33:38 +02:00
parent fe6d1247ad
commit 76fb1fe6f6

View File

@ -170,6 +170,8 @@ prune_non_exact (struct robot_specs *specs)
for (i = 0, j = 0; i < specs->count; i++)
if (specs->paths[i].user_agent_exact_p)
newpaths[j++] = specs->paths[i];
else
xfree (specs->paths[i].path);
assert (j == cnt);
xfree (specs->paths);
specs->paths = newpaths;