From 76fb1fe6f628215a77d8f8254e2c472218158e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Wed, 25 Apr 2018 11:33:38 +0200 Subject: [PATCH] * 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. --- src/res.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/res.c b/src/res.c index 278ca936..0062c63a 100644 --- a/src/res.c +++ b/src/res.c @@ -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;