From: Joel Rosdahl Date: Tue, 12 Jul 2011 19:30:01 +0000 (+0200) Subject: Correctly free name in expand_variable X-Git-Tag: v3.2~242 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7c9fd3c5c3fce5579988d6ad0ffa81786096e330;p=thirdparty%2Fccache.git Correctly free name in expand_variable --- diff --git a/util.c b/util.c index 3a32411b7..810ccc7fb 100644 --- a/util.c +++ b/util.c @@ -1316,6 +1316,7 @@ expand_variable(const char **str, char **result, char **errmsg) value = getenv(name); if (!value) { *errmsg = format("environment variable \"%s\" not set", name); + free(name); return false; } x_asprintf2(result, "%s%s", *result, value); @@ -1323,6 +1324,7 @@ expand_variable(const char **str, char **result, char **errmsg) --q; } *str = q; + free(name); return true; }