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, 15 Feb 2020 21:56:49 +0000 (21:56 +0000)
commit717c472de2c8b65950ebaca09666718fb670bcb4
tree2d830c8ea3c56d1239699b52272f7381feefc237
parentdffca6e2220c60519e52ac03438f37a0aa513293
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