-fix use of uninit memory

This commit is contained in:
Christian Grothoff 2015-04-30 11:01:06 +02:00
parent 5a8eccb4c4
commit e591651937

View File

@ -1127,6 +1127,7 @@ postgres_get_collectable_blindcoin (void *cls,
ret = GNUNET_SYSERR; ret = GNUNET_SYSERR;
denom_pub = NULL; denom_pub = NULL;
denom_pub_enc = NULL; denom_pub_enc = NULL;
denom_sig = NULL;
denom_sig_enc = NULL; denom_sig_enc = NULL;
result = TALER_PQ_exec_prepared (session->conn, result = TALER_PQ_exec_prepared (session->conn,
"get_collectable_blindcoin", "get_collectable_blindcoin",
@ -1159,7 +1160,8 @@ postgres_get_collectable_blindcoin (void *cls,
denom_pub_enc_size); denom_pub_enc_size);
denom_sig = GNUNET_CRYPTO_rsa_signature_decode (denom_sig_enc, denom_sig = GNUNET_CRYPTO_rsa_signature_decode (denom_sig_enc,
denom_sig_enc_size); denom_sig_enc_size);
if ((NULL == denom_pub) || (NULL == denom_sig)) if ( (NULL == denom_pub) ||
(NULL == denom_sig) )
{ {
GNUNET_break (0); GNUNET_break (0);
goto cleanup; goto cleanup;
@ -1173,7 +1175,8 @@ postgres_get_collectable_blindcoin (void *cls,
GNUNET_free_non_null (denom_pub_enc); GNUNET_free_non_null (denom_pub_enc);
GNUNET_free_non_null (denom_sig_enc); GNUNET_free_non_null (denom_sig_enc);
if (GNUNET_YES != ret) if (GNUNET_YES != ret)
{ if (NULL != denom_pub) {
if (NULL != denom_pub)
GNUNET_CRYPTO_rsa_public_key_free (denom_pub); GNUNET_CRYPTO_rsa_public_key_free (denom_pub);
if (NULL != denom_sig) if (NULL != denom_sig)
GNUNET_CRYPTO_rsa_signature_free (denom_sig); GNUNET_CRYPTO_rsa_signature_free (denom_sig);
@ -1229,7 +1232,11 @@ postgres_insert_collectable_blindcoin (void *cls,
}; };
if (GNUNET_OK != postgres_start (cls, if (GNUNET_OK != postgres_start (cls,
session)) session))
goto cleanup; {
GNUNET_free_non_null (denom_pub_enc);
GNUNET_free_non_null (denom_sig_enc);
return GNUNET_SYSERR;
}
result = TALER_PQ_exec_prepared (session->conn, result = TALER_PQ_exec_prepared (session->conn,
"insert_collectable_blindcoin", "insert_collectable_blindcoin",
params); params);