From: Joel Rosdahl Date: Mon, 27 Jan 2020 21:05:48 +0000 (+0100) Subject: Fix memory leak X-Git-Tag: v4.0~660 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ec989d161ca01e99c1e81a41c58adfec0efd4d16;p=thirdparty%2Fccache.git Fix memory leak --- 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()) {