]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix two dumb leaks in crypto.c
authorNick Mathewson <nickm@torproject.org>
Mon, 12 Apr 2004 05:27:38 +0000 (05:27 +0000)
committerNick Mathewson <nickm@torproject.org>
Mon, 12 Apr 2004 05:27:38 +0000 (05:27 +0000)
svn:r1592

src/common/crypto.c

index 278fe1dedda02ccba0e4bd32878cd012bab2cea9..88330892bccea4238b6f2f04a8501c7c5666a256 100644 (file)
@@ -351,6 +351,7 @@ int crypto_pk_read_public_key_from_string(crypto_pk_env_t *env, const char *src,
   if (env->key)
     RSA_free(env->key);
   env->key = PEM_read_bio_RSAPublicKey(b, NULL, NULL, NULL);
+  BIO_free(b);
   if(!env->key)
     return -1;
 
@@ -708,6 +709,7 @@ int crypto_pk_get_digest(crypto_pk_env_t *pk, char *digest_out)
     free(buf);
     return -1;
   }
+  free(buf);
   return 0;
 }