From f2de0ff5f1ae1cadf8693d91a3e323df8900a346 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Thu, 8 Sep 2005 00:22:35 +0000 Subject: Don't free variables put in through putenv --- common/compat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/compat.c b/common/compat.c index 1f1736b..9828a41 100644 --- a/common/compat.c +++ b/common/compat.c @@ -193,7 +193,8 @@ int setenv(const char* name, const char* value, int overwrite) if(!t) return -1; sprintf(t, "%s=%s", name, value); r = putenv(t); - free(t); + if(r != 0) + free(t); return r; } -- cgit v1.2.3