Commit 6fc385081e2db25abda9492c1dbca7b3a1c6b62b

Steffen Jaeckel 2014-02-14T12:59:04

demo: clean-up on exit

diff --git a/demo/demo.c b/demo/demo.c
index 944b236..e2cc8c0 100644
--- a/demo/demo.c
+++ b/demo/demo.c
@@ -70,12 +70,16 @@ int myrng(unsigned char *dst, int len, void *dat)
    return len;
 }
 
+mp_int a, b, c, d, e, f;
 
+static void _cleanup(void)
+{
+  mp_clear_multi(&a, &b, &c, &d, &e, &f, NULL);
+}
 
 char cmd[4096], buf[4096];
 int main(void)
 {
-   mp_int a, b, c, d, e, f;
    unsigned long t;
    unsigned rr;
    int i, n, err, cnt, ix;