gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r31127 - gnunet/src/scalarproduct


From: gnunet
Subject: [GNUnet-SVN] r31127 - gnunet/src/scalarproduct
Date: Thu, 5 Dec 2013 23:54:52 +0100

Author: grothoff
Date: 2013-12-05 23:54:52 +0100 (Thu, 05 Dec 2013)
New Revision: 31127

Modified:
   gnunet/src/scalarproduct/gnunet-service-scalarproduct.c
Log:
-initialize to NULL to use non-free if 'goto except' is hit

Modified: gnunet/src/scalarproduct/gnunet-service-scalarproduct.c
===================================================================
--- gnunet/src/scalarproduct/gnunet-service-scalarproduct.c     2013-12-05 
22:42:20 UTC (rev 31126)
+++ gnunet/src/scalarproduct/gnunet-service-scalarproduct.c     2013-12-05 
22:54:52 UTC (rev 31127)
@@ -1254,16 +1254,19 @@
   }
   GNUNET_free (response->vector);
   response->vector = NULL;
-
+  q = NULL;
+  p = NULL;
   tmp_exp = gcry_sexp_find_token (request->remote_pubkey, "n", 0);
-  if (!tmp_exp) {
+  if (!tmp_exp)
+  {
     GNUNET_break_op (0);
     gcry_sexp_release (request->remote_pubkey);
     request->remote_pubkey = NULL;
     goto except;
   }
   remote_n = gcry_sexp_nth_mpi (tmp_exp, 1, GCRYMPI_FMT_USG);
-  if (!remote_n) {
+  if (!remote_n)
+  {
     GNUNET_break (0);
     gcry_sexp_release (tmp_exp);
     goto except;
@@ -1274,13 +1277,15 @@
   tmp_exp = gcry_sexp_find_token (request->remote_pubkey, "g", 0);
   gcry_sexp_release (request->remote_pubkey);
   request->remote_pubkey = NULL;
-  if (!tmp_exp) {
+  if (!tmp_exp)
+  {
     GNUNET_break_op (0);
     gcry_mpi_release (remote_n);
     goto except;
   }
   remote_g = gcry_sexp_nth_mpi (tmp_exp, 1, GCRYMPI_FMT_USG);
-  if (!remote_g) {
+  if (!remote_g)
+  {
     GNUNET_break (0);
     gcry_mpi_release (remote_n);
     gcry_sexp_release (tmp_exp);
@@ -1397,8 +1402,8 @@
   GNUNET_free (b);
   GNUNET_free (request->a);
   request->a = NULL;
-  GNUNET_free (p);
-  GNUNET_free (q);
+  GNUNET_free_non_null (p);
+  GNUNET_free_non_null (q);
   GNUNET_free (rand);
   return ret;
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]