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>
Mon, 30 Dec 2019 13:15:49 +0000 (13:15 +0000)
commit2992911cb21ca5e58ed1d200ff7b1a3d03836422
treecfc7a59df4b7b71aeb16ff7788b18ca0b8ec87e6
parent17f154096491925d9538831e029a10a6be839c83
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