chiark / gitweb /
rsa1: rsa_loadpriv_core: Always free b, and zero things we free
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 6 Oct 2019 21:16:01 +0000 (22:16 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Dec 2019 17:08:51 +0000 (17:08 +0000)
commit88b6a3265c23461a3462dbb07ed891bc677f619c
treefe049e420f8ba5c83fe9a359b2680e7edae7a579
parent029fec2038d1611f69fabd65bd2ee3fa28712fe7
rsa1: rsa_loadpriv_core: Always free b, and zero things we free

Make the FREE macro zero its argument.  This makes it idempotent.

This means that at the end of the function, and at all points where
LD* is called, b is either from malloc and freeable, or null.  It is
never a free'd pointer.

So we can free it.  This is moving us towards always unconditionally
freeing everything on the exit path, to support non-fatal early
return.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
rsa.c