gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] branch master updated (bbdd987 -> 8cbdf68)


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated (bbdd987 -> 8cbdf68)
Date: Mon, 06 Mar 2017 13:26:24 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a change to branch master
in repository merchant.

    from bbdd987  implement #4752
     new 690b9c9  avoid memory leak on DB connect error
     new 8cbdf68  check if field is present before going for full spec-parser

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/backend/taler-merchant-httpd_pay.c     | 8 +++++++-
 src/backenddb/plugin_merchantdb_postgres.c | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_pay.c 
b/src/backend/taler-merchant-httpd_pay.c
index 090ae14..f2773ed 100644
--- a/src/backend/taler-merchant-httpd_pay.c
+++ b/src/backend/taler-merchant-httpd_pay.c
@@ -1,6 +1,6 @@
 /*
   This file is part of TALER
-  (C) 2014, 2015, 2016, 2017 GNUnet e.V. and INRIA
+  (C) 2014-2017 GNUnet e.V. and INRIA
 
   TALER is free software; you can redistribute it and/or modify it under the
   terms of the GNU Affero General Public License as published by the Free 
Software
@@ -1060,6 +1060,8 @@ parse_pay (struct MHD_Connection *connection,
   }
 
   /* parse optional details */
+  if (NULL != json_object_get (pc->proposal_data,
+                               "max_wire_fee"))
   {
     struct GNUNET_JSON_Specification espec[] = {
       TALER_JSON_spec_amount ("max_wire_fee",
@@ -1072,12 +1074,15 @@ parse_pay (struct MHD_Connection *connection,
                                espec);
     if (GNUNET_YES != res)
     {
+      GNUNET_break_op (0); /* invalid input, use default */
       /* default is we cover no fee */
       GNUNET_assert (GNUNET_OK ==
                      TALER_amount_get_zero (pc->max_fee.currency,
                                             &pc->max_wire_fee));
     }
   }
+  if (NULL != json_object_get (pc->proposal_data,
+                               "wire_fee_amortization"))
   {
     struct GNUNET_JSON_Specification espec[] = {
       GNUNET_JSON_spec_uint32 ("wire_fee_amortization",
@@ -1091,6 +1096,7 @@ parse_pay (struct MHD_Connection *connection,
     if ( (GNUNET_YES != res) ||
          (0 == pc->wire_fee_amortization) )
     {
+      GNUNET_break_op (0); /* invalid input, use default */
       /* default is no amortization */
       pc->wire_fee_amortization = 1;
     }
diff --git a/src/backenddb/plugin_merchantdb_postgres.c 
b/src/backenddb/plugin_merchantdb_postgres.c
index 1229f10..ae2ead4 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -1350,7 +1350,7 @@ libtaler_plugin_merchantdb_postgres_init (void *cls)
   pg->conn = GNUNET_POSTGRES_connect (cfg, "merchantdb-postgres");
   if (NULL == pg->conn)
   {
-    GNUNET_break (0);
+    GNUNET_free (pg);
     return NULL;
   }
   plugin = GNUNET_new (struct TALER_MERCHANTDB_Plugin);

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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