do not run cleaner on part that was never setup
authorChristian Grothoff <christian@grothoff.org>
Sat, 7 Dec 2019 15:58:43 +0000 (16:58 +0100)
committerChristian Grothoff <christian@grothoff.org>
Sat, 7 Dec 2019 15:58:43 +0000 (16:58 +0100)
src/my/my.c
src/pq/pq.c

index 41d280d5e56d388ff67b9c07ea109c32ca86a1cf..a4099d088888eeb4187b4dbc6cd2c76a79b6dd6c 100644 (file)
@@ -237,7 +237,10 @@ GNUNET_MY_extract_result (struct GNUNET_MYSQL_StatementHandle *sh,
                       "Post-conversion for MySQL result failed at offset %u\n",
                       i);
           mysql_stmt_free_result (stmt);
-          GNUNET_MY_cleanup_result (rs);
+          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;
         }
       field_off += rp->num_fields;
index d2b9a6174dec3c02e2c83815c08304e5008346ed..eca097e58994bed738c059fcf7a59e894c9cf64a 100644 (file)
@@ -168,7 +168,10 @@ GNUNET_PQ_extract_result (PGresult *result,
                       spec->dst);
     if (GNUNET_OK != ret)
     {
-      GNUNET_PQ_cleanup_result (rs);
+      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;
     }
     if (NULL != spec->result_size)