]> git.tue.mpg.de Git - paraslash.git/commitdiff
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 46a90533489696df9c3fb2eff665535b3bf2e0bf..0d8b42410ea133355d396a2c689ddaf84b12c160 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;
 }