diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-12-05 22:54:52 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-12-05 22:54:52 +0000 |
commit | 54717d7654c83f5989ed37d2a93c31e04060d32a (patch) | |
tree | c7ee83d195f83858a310d55bdbc81d6800684651 /src/scalarproduct | |
parent | 1287db0000e5f00c3ad9ee8327ba4404d6c2f8b0 (diff) | |
download | gnunet-54717d7654c83f5989ed37d2a93c31e04060d32a.tar.gz gnunet-54717d7654c83f5989ed37d2a93c31e04060d32a.zip |
-initialize to NULL to use non-free if 'goto except' is hit
Diffstat (limited to 'src/scalarproduct')
-rw-r--r-- | src/scalarproduct/gnunet-service-scalarproduct.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/scalarproduct/gnunet-service-scalarproduct.c b/src/scalarproduct/gnunet-service-scalarproduct.c index ba9d426b8..43b5d0107 100644 --- a/src/scalarproduct/gnunet-service-scalarproduct.c +++ b/src/scalarproduct/gnunet-service-scalarproduct.c | |||
@@ -1254,16 +1254,19 @@ compute_service_response (struct ServiceSession * request, | |||
1254 | } | 1254 | } |
1255 | GNUNET_free (response->vector); | 1255 | GNUNET_free (response->vector); |
1256 | response->vector = NULL; | 1256 | response->vector = NULL; |
1257 | 1257 | q = NULL; | |
1258 | p = NULL; | ||
1258 | tmp_exp = gcry_sexp_find_token (request->remote_pubkey, "n", 0); | 1259 | tmp_exp = gcry_sexp_find_token (request->remote_pubkey, "n", 0); |
1259 | if (!tmp_exp) { | 1260 | if (!tmp_exp) |
1261 | { | ||
1260 | GNUNET_break_op (0); | 1262 | GNUNET_break_op (0); |
1261 | gcry_sexp_release (request->remote_pubkey); | 1263 | gcry_sexp_release (request->remote_pubkey); |
1262 | request->remote_pubkey = NULL; | 1264 | request->remote_pubkey = NULL; |
1263 | goto except; | 1265 | goto except; |
1264 | } | 1266 | } |
1265 | remote_n = gcry_sexp_nth_mpi (tmp_exp, 1, GCRYMPI_FMT_USG); | 1267 | remote_n = gcry_sexp_nth_mpi (tmp_exp, 1, GCRYMPI_FMT_USG); |
1266 | if (!remote_n) { | 1268 | if (!remote_n) |
1269 | { | ||
1267 | GNUNET_break (0); | 1270 | GNUNET_break (0); |
1268 | gcry_sexp_release (tmp_exp); | 1271 | gcry_sexp_release (tmp_exp); |
1269 | goto except; | 1272 | goto except; |
@@ -1274,13 +1277,15 @@ compute_service_response (struct ServiceSession * request, | |||
1274 | tmp_exp = gcry_sexp_find_token (request->remote_pubkey, "g", 0); | 1277 | tmp_exp = gcry_sexp_find_token (request->remote_pubkey, "g", 0); |
1275 | gcry_sexp_release (request->remote_pubkey); | 1278 | gcry_sexp_release (request->remote_pubkey); |
1276 | request->remote_pubkey = NULL; | 1279 | request->remote_pubkey = NULL; |
1277 | if (!tmp_exp) { | 1280 | if (!tmp_exp) |
1281 | { | ||
1278 | GNUNET_break_op (0); | 1282 | GNUNET_break_op (0); |
1279 | gcry_mpi_release (remote_n); | 1283 | gcry_mpi_release (remote_n); |
1280 | goto except; | 1284 | goto except; |
1281 | } | 1285 | } |
1282 | remote_g = gcry_sexp_nth_mpi (tmp_exp, 1, GCRYMPI_FMT_USG); | 1286 | remote_g = gcry_sexp_nth_mpi (tmp_exp, 1, GCRYMPI_FMT_USG); |
1283 | if (!remote_g) { | 1287 | if (!remote_g) |
1288 | { | ||
1284 | GNUNET_break (0); | 1289 | GNUNET_break (0); |
1285 | gcry_mpi_release (remote_n); | 1290 | gcry_mpi_release (remote_n); |
1286 | gcry_sexp_release (tmp_exp); | 1291 | gcry_sexp_release (tmp_exp); |
@@ -1397,8 +1402,8 @@ except: | |||
1397 | GNUNET_free (b); | 1402 | GNUNET_free (b); |
1398 | GNUNET_free (request->a); | 1403 | GNUNET_free (request->a); |
1399 | request->a = NULL; | 1404 | request->a = NULL; |
1400 | GNUNET_free (p); | 1405 | GNUNET_free_non_null (p); |
1401 | GNUNET_free (q); | 1406 | GNUNET_free_non_null (q); |
1402 | GNUNET_free (rand); | 1407 | GNUNET_free (rand); |
1403 | return ret; | 1408 | return ret; |
1404 | } | 1409 | } |