aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-12-07 16:58:43 +0100
committerChristian Grothoff <christian@grothoff.org>2019-12-07 16:58:43 +0100
commit4bcfd0476d3074a93e880320951345d8a9435838 (patch)
tree95f4cff6f59c6cb998d84817729aae663c8ecae4
parent27ca93e0dbd2552835d7046dd0ee1ab3c2c83f47 (diff)
downloadgnunet-4bcfd0476d3074a93e880320951345d8a9435838.tar.gz
gnunet-4bcfd0476d3074a93e880320951345d8a9435838.zip
do not run cleaner on part that was never setup
-rw-r--r--src/my/my.c5
-rw-r--r--src/pq/pq.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/my/my.c b/src/my/my.c
index 41d280d5e..a4099d088 100644
--- a/src/my/my.c
+++ b/src/my/my.c
@@ -237,7 +237,10 @@ GNUNET_MY_extract_result (struct GNUNET_MYSQL_StatementHandle *sh,
237 "Post-conversion for MySQL result failed at offset %u\n", 237 "Post-conversion for MySQL result failed at offset %u\n",
238 i); 238 i);
239 mysql_stmt_free_result (stmt); 239 mysql_stmt_free_result (stmt);
240 GNUNET_MY_cleanup_result (rs); 240 for (unsigned int j = 0; j < i; j++)
241 if (NULL != rs[j].cleaner)
242 rs[j].cleaner (rs[j].cls,
243 rs[j].dst);
241 return GNUNET_SYSERR; 244 return GNUNET_SYSERR;
242 } 245 }
243 field_off += rp->num_fields; 246 field_off += rp->num_fields;
diff --git a/src/pq/pq.c b/src/pq/pq.c
index d2b9a6174..eca097e58 100644
--- a/src/pq/pq.c
+++ b/src/pq/pq.c
@@ -168,7 +168,10 @@ GNUNET_PQ_extract_result (PGresult *result,
168 spec->dst); 168 spec->dst);
169 if (GNUNET_OK != ret) 169 if (GNUNET_OK != ret)
170 { 170 {
171 GNUNET_PQ_cleanup_result (rs); 171 for (unsigned int j = 0; j < i; j++)
172 if (NULL != rs[j].cleaner)
173 rs[j].cleaner (rs[j].cls,
174 rs[j].dst);
172 return GNUNET_SYSERR; 175 return GNUNET_SYSERR;
173 } 176 }
174 if (NULL != spec->result_size) 177 if (NULL != spec->result_size)