summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-04-30 11:01:06 +0200
committerChristian Grothoff <christian@grothoff.org>2015-04-30 11:01:06 +0200
commite5916519372904a16a9ccb9093ac2da1241a73e9 (patch)
tree40764e7802321047af4911531f7954254000fdd2 /src
parent5a8eccb4c4d6eb03007564871947f3a1bd873ad2 (diff)
downloadexchange-e5916519372904a16a9ccb9093ac2da1241a73e9.tar.gz
exchange-e5916519372904a16a9ccb9093ac2da1241a73e9.tar.bz2
exchange-e5916519372904a16a9ccb9093ac2da1241a73e9.zip
-fix use of uninit memory
Diffstat (limited to 'src')
-rw-r--r--src/mintdb/plugin_mintdb_postgres.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mintdb/plugin_mintdb_postgres.c b/src/mintdb/plugin_mintdb_postgres.c
index 772b8342e..56ba1bbde 100644
--- a/src/mintdb/plugin_mintdb_postgres.c
+++ b/src/mintdb/plugin_mintdb_postgres.c
@@ -1127,6 +1127,7 @@ postgres_get_collectable_blindcoin (void *cls,
ret = GNUNET_SYSERR;
denom_pub = NULL;
denom_pub_enc = NULL;
+ denom_sig = NULL;
denom_sig_enc = NULL;
result = TALER_PQ_exec_prepared (session->conn,
"get_collectable_blindcoin",
@@ -1159,7 +1160,8 @@ postgres_get_collectable_blindcoin (void *cls,
denom_pub_enc_size);
denom_sig = GNUNET_CRYPTO_rsa_signature_decode (denom_sig_enc,
denom_sig_enc_size);
- if ((NULL == denom_pub) || (NULL == denom_sig))
+ if ( (NULL == denom_pub) ||
+ (NULL == denom_sig) )
{
GNUNET_break (0);
goto cleanup;
@@ -1173,7 +1175,8 @@ postgres_get_collectable_blindcoin (void *cls,
GNUNET_free_non_null (denom_pub_enc);
GNUNET_free_non_null (denom_sig_enc);
if (GNUNET_YES != ret)
- { if (NULL != denom_pub)
+ {
+ if (NULL != denom_pub)
GNUNET_CRYPTO_rsa_public_key_free (denom_pub);
if (NULL != 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,
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,
"insert_collectable_blindcoin",
params);