summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/core-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-09-02 04:05:34 +0200
committerLennart Poettering <lennart@poettering.net>2009-09-02 04:05:34 +0200
commit297afadbef238f7a37f65bd3740a2ce24861c414 (patch)
tree18b2f626e1143c0c1169f861d76be0e09f895c0b /src/pulsecore/core-util.c
parent1200a0b143c370c1a9351add5f72ecabfd8630cf (diff)
core-util: don't leak memory in pa_unset_env_recorded()
Diffstat (limited to 'src/pulsecore/core-util.c')
-rw-r--r--src/pulsecore/core-util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 9034dc32..a3c60130 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);