gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated: -debug assist


From: gnunet
Subject: [gnunet] branch master updated: -debug assist
Date: Wed, 16 Jun 2021 20:54:21 +0200

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

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 93473ba6b -debug assist
93473ba6b is described below

commit 93473ba6b51f1b75959a25602036195c0df0e315
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Jun 16 20:51:25 2021 +0200

    -debug assist
---
 src/pq/pq.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/pq/pq.c b/src/pq/pq.c
index 25202a640..356472fa3 100644
--- a/src/pq/pq.c
+++ b/src/pq/pq.c
@@ -128,9 +128,11 @@ GNUNET_PQ_extract_result (PGresult *result,
                           struct GNUNET_PQ_ResultSpec *rs,
                           int row)
 {
+  unsigned int i;
+
   if (NULL == result)
     return GNUNET_SYSERR;
-  for (unsigned int i = 0; NULL != rs[i].conv; i++)
+  for (i = 0; NULL != rs[i].conv; i++)
   {
     struct GNUNET_PQ_ResultSpec *spec;
     enum GNUNET_GenericReturnValue ret;
@@ -156,18 +158,24 @@ GNUNET_PQ_extract_result (PGresult *result,
           *spec->is_null = true;
         continue;
       }
-    /* intentional fall-through: NULL value for field that is NOT nullable */
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                  "NULL field encountered for `%s' where non-NULL was 
required\n",
+                  spec->fname);
+      goto cleanup;
     case GNUNET_SYSERR:
-      for (unsigned int j = 0; j < i; j++)
-        if (NULL != rs[j].cleaner)
-          rs[j].cleaner (rs[j].cls,
-                         rs[j].dst);
-      return GNUNET_SYSERR;
+      GNUNET_break (0);
+      goto cleanup;
     }
     if (NULL != spec->result_size)
       *spec->result_size = spec->dst_size;
   }
   return GNUNET_OK;
+cleanup:
+  for (unsigned int j = 0; j < i; j++)
+    if (NULL != rs[j].cleaner)
+      rs[j].cleaner (rs[j].cls,
+                     rs[j].dst);
+  return GNUNET_SYSERR;
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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