crypt.c: fix memory leak in para_decrypt_buffer()
authorAndre Noll <maan@systemlinux.org>
Sun, 11 Feb 2007 22:11:28 +0000 (23:11 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 11 Feb 2007 22:11:28 +0000 (23:11 +0100)
The client side had more or less the same memory leak as the server side:
The rsa structure wasn't freed.

crypt.c

diff --git a/crypt.c b/crypt.c
index 46a9053..0d8b424 100644 (file)
--- a/crypt.c
+++ b/crypt.c
@@ -101,6 +101,7 @@ int para_decrypt_buffer(char *key_file, unsigned char *outbuf, unsigned char *in
        if (ret < 0)
                return ret;
        ret = RSA_private_decrypt(rsa_inlen, inbuf, outbuf, rsa, RSA_PKCS1_PADDING);
+       rsa_free(rsa);
        return (ret > 0)? ret : -E_DECRYPT;
 }