-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 01/18/2014 10:32 AM, Toralf Förster wrote:
> According to https://www.openssl.org/docs/crypto/pem.html free the
> memory before, otherwise cppcheck blames it b/c of :
> 
> [crypt_prog.cpp:366]: (error) Memory leak: rsa_key_
> [crypt_prog.cpp:380]: (error) Memory leak: rsa_key_
> 
> 

Hhm thinking twice about it (after a cup of tea) this might be the better way, 
or ?


tfoerste@n22 ~/devel/boinc-v2 $ cat ~/tmp/init_rsa_key.patch
diff --git a/lib/crypt_prog.cpp b/lib/crypt_prog.cpp
index 3d45361..473308f 100644
- --- a/lib/crypt_prog.cpp
+++ b/lib/crypt_prog.cpp
@@ -357,7 +357,7 @@ int main(int argc, char** argv) {
             }
         } else {
             // o2b
- -            rsa_key_ = (RSA *)calloc(1, sizeof(RSA));
+            rsa_key_ = RSA_new();
             if (rsa_key_ == NULL) {
                 die("could not allocate memory for RSA structure.\n");
             }

- -- 
MfG/Sincerely
Toralf Förster
pgp finger print:1A37 6F99 4A9D 026F 13E2 4DCF C4EA CDDE 0076 E94E
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iF4EAREIAAYFAlLajm8ACgkQxOrN3gB26U6v4wD+K5Au/5mu1E3VwPL7VEU2cQcN
nAanOSaPlRbKysWAnlsA/2L/Qh+VNu16nkE75gUCKwXuugBbo0jblysU0NR4iQB9
=pO4s
-----END PGP SIGNATURE-----
_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.

Reply via email to