diff options
-rw-r--r-- | common/compat.c | 3 |
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; } |