From ec989d161ca01e99c1e81a41c58adfec0efd4d16 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Mon, 27 Jan 2020 22:05:48 +0100 Subject: [PATCH] Fix memory leak --- src/ccache.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ccache.cpp b/src/ccache.cpp index 6a268183f..96f8fd81d 100644 --- a/src/ccache.cpp +++ b/src/ccache.cpp @@ -834,7 +834,9 @@ process_preprocessed_file(struct hash* hash, const char* path, bool pump) if (!has_absolute_include_headers) { has_absolute_include_headers = is_absolute_path(inc_path); } + char* saved_inc_path = inc_path; inc_path = x_strdup(make_relative_path(inc_path).c_str()); + free(saved_inc_path); bool should_hash_inc_path = true; if (!g_config.hash_dir()) { -- 2.47.3