chiark / gitweb /
rsa: Move FREE macro up
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 23 Nov 2019 13:49:22 +0000 (13:49 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Feb 2020 21:56:50 +0000 (21:56 +0000)
The public key half of this file is going to want this too.

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

diff --git a/rsa.c b/rsa.c
index 3ce72b86fcdbbb3b609cf092943a7eb38f3614c3..5921abda151130b2ce20968baf3591ded689249b 100644 (file)
--- a/rsa.c
+++ b/rsa.c
@@ -45,6 +45,8 @@ struct rsacommon {
     uint8_t *hashbuf;
 };
 
+#define FREE(b)                ({ free((b)); (b)=0; })
+
 struct load_ctx {
     void (*verror)(struct load_ctx *l,
                   FILE *maybe_f, bool_t unsup,
@@ -372,7 +374,6 @@ static void load_error(struct load_ctx *l, FILE *maybe_f,
 #define LDUNSUP(...)      ({ load_error(l,0,1,__VA_ARGS__); goto error_out; })
 #define LDFATAL_FILE(...) ({ load_error(l,f,0,__VA_ARGS__); goto error_out; })
 #define LDUNSUP_FILE(...) ({ load_error(l,f,1,__VA_ARGS__); goto error_out; })
-#define FREE(b)                ({ free((b)); (b)=0; })
 #define KEYFILE_GET(is)   ({                                   \
        uint##is##_t keyfile_get_tmp=keyfile_get_##is(l,f);     \
        if (!l->postreadcheck(l,f)) goto error_out;             \