Never call putenv() with data on the stack.
authorGuus Sliepen <guus@tinc-vpn.org>
Sun, 3 May 2015 18:06:12 +0000 (20:06 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Sun, 10 Apr 2016 15:42:23 +0000 (17:42 +0200)
commitcadbf587a09bd4adde664cd635b962315228b3f5
treee1a2534e43ebf4e7b4434d6f6935cb8d51614712
parent0e8e53b4cee8f1ea27bad501cbc18292ced54fa1
Never call putenv() with data on the stack.

Even though we are using putenv() here to remove items from the
environment, there is no guarantee that putenv() doesn't add the
argument to the environment anyway. In that case, we have to make sure
that it doesn't go away. We also don't want a memory leak, so keep a
list of things we unputenv()ed around, so we can reuse things.

Thanks to Poul-Henning Kamp for pointing out this problem.

# Conflicts:
# src/process.c
src/script.c