summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
dffca6e)
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>
#define LDUNSUP(...) cfgfatal(loc,"rsa-private",__VA_ARGS__)
#define LDFATAL_FILE(...) cfgfatal_maybefile(f,loc,"rsa-private",__VA_ARGS__)
#define LDUNSUP_FILE(...) cfgfatal_maybefile(f,loc,"rsa-private",__VA_ARGS__)
#define LDUNSUP(...) cfgfatal(loc,"rsa-private",__VA_ARGS__)
#define LDFATAL_FILE(...) cfgfatal_maybefile(f,loc,"rsa-private",__VA_ARGS__)
#define LDUNSUP_FILE(...) cfgfatal_maybefile(f,loc,"rsa-private",__VA_ARGS__)
+#define FREE(b) ({ free((b)); (b)=0; })
static void rsapriv_dispose(void *sst)
{
static void rsapriv_dispose(void *sst)
{
mpz_clear(&tmp2);
mpz_clear(&tmp3);
mpz_clear(&tmp2);
mpz_clear(&tmp3);
FREE(c);
mpz_clear(&e);
mpz_clear(&d);
FREE(c);
mpz_clear(&e);
mpz_clear(&d);