summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2005-09-08 00:22:35 +0000
committerStef Walter <stef@memberwebs.com>2005-09-08 00:22:35 +0000
commit540d0cc9c250614b51b44e5837c3f547db5ebdc3 (patch)
treebe3602fde1e0d4a592f16b2945560c17f5a5e474
parenta9f212b09ddf1fe1c621cdb7f7ccb0357f659d7f (diff)
Don't free variables put in through putenv
-rw-r--r--common/compat.c3
1 files changed, 2 insertions, 1 deletions
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;
}