Fix two dumb leaks in crypto.c

svn:r1592
This commit is contained in:
Nick Mathewson 2004-04-12 05:27:38 +00:00
parent 1dbf61e7e6
commit 306adfc8bd

View File

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