From fe323ee39d953a29d70f0ae827f3cddc090c2f2b Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 21 Jul 2016 14:37:20 -0400 Subject: [PATCH 18/36] FIXME: fix leaks in libcpp/files.c --- libcpp/files.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libcpp/files.c b/libcpp/files.c index c8bb637..c37417a6 100644 --- a/libcpp/files.c +++ b/libcpp/files.c @@ -417,6 +417,7 @@ find_file_in_dir (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch, hv = htab_hash_string (path); if (htab_find_with_hash (pfile->nonexistent_file_hash, path, hv) != NULL) { + free (path); file->err_no = ENOENT; return false; } @@ -1132,6 +1133,7 @@ destroy_cpp_file (_cpp_file *file) { free ((void *) file->buffer_start); free ((void *) file->name); + free ((void *) file->path); free (file); } -- 1.8.5.3