From: Lennart Poettering Date: Wed, 2 Sep 2009 02:05:34 +0000 (+0200) Subject: core-util: don't leak memory in pa_unset_env_recorded() X-Git-Tag: v0.9.16-test7~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=297afadbef238f7a37f65bd3740a2ce24861c414;p=platform%2Fupstream%2Fpulseaudio.git core-util: don't leak memory in pa_unset_env_recorded() --- diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index 9034dc3..a3c6013 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -2474,9 +2474,11 @@ void pa_unset_env_recorded(void) { /* This is not thread-safe */ for (;;) { - char *s = NULL; + char *s; - if (!(recorded_env = pa_strlist_pop(recorded_env, &s))) + recorded_env = pa_strlist_pop(recorded_env, &s); + + if (!s) break; unsetenv(s);