From: Joel Rosdahl Date: Wed, 4 Feb 2015 20:17:17 +0000 (+0100) Subject: Fix minor memory leaks X-Git-Tag: v3.2.2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30686d9a3e161cb2ed7f3ddf387888dafaabe148;p=thirdparty%2Fccache.git Fix minor memory leaks --- diff --git a/ccache.c b/ccache.c index c0c6d51f5..46bee3082 100644 --- a/ccache.c +++ b/ccache.c @@ -1275,10 +1275,14 @@ calculate_common_hash(struct args *args, struct mdfour *hash) if (profile_dir) { dir = x_strdup(profile_dir); } else { - dir = x_realpath(dir); + char *real_dir = x_realpath(dir); + free(dir); + dir = real_dir; } if (dir) { - p = remove_extension(basename(output_obj)); + char *base_name = basename(output_obj); + p = remove_extension(base_name); + free(base_name); gcda_path = format("%s/%s.gcda", dir, p); cc_log("Hashing coverage path %s", gcda_path); free(p);