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, 3 May 2015 18:10:26 +0000 (20:10 +0200)
commitbb616245b7883ab30291cd8d46672ed2ae733166
treeb1ff1193cb457eb7f05067b9d5fcee8b00eefa31
parent0821e327f23d81e4b001479b9de62151a3c0a1bc
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.
src/process.c