aboutsummaryrefslogtreecommitdiff
path: root/src/my
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-06-21 13:17:16 +0000
committerChristian Grothoff <christian@grothoff.org>2016-06-21 13:17:16 +0000
commit1732154b8c021e7ee0e34c28cf3b1a843454727a (patch)
tree3cb7fd79f409467c07d831ec055ebcdc8bfe61a2 /src/my
parent8919055de77f692ce3f0c1b9781fc9011de9cb6f (diff)
downloadgnunet-1732154b8c021e7ee0e34c28cf3b1a843454727a.tar.gz
gnunet-1732154b8c021e7ee0e34c28cf3b1a843454727a.zip
towards fixing mysql plugin
Diffstat (limited to 'src/my')
-rw-r--r--src/my/my.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/my/my.c b/src/my/my.c
index 5ef2f18cf..ae46a2888 100644
--- a/src/my/my.c
+++ b/src/my/my.c
@@ -55,7 +55,7 @@ GNUNET_MY_exec_prepared (struct GNUNET_MYSQL_Context *mc,
55 MYSQL_BIND qbind[num]; 55 MYSQL_BIND qbind[num];
56 unsigned int off; 56 unsigned int off;
57 57
58 memset(qbind, 0, sizeof(qbind)); 58 memset (qbind, 0, sizeof(qbind));
59 off = 0; 59 off = 0;
60 for (i=0;NULL != (p = &params[i])->conv;i++) 60 for (i=0;NULL != (p = &params[i])->conv;i++)
61 { 61 {
@@ -71,7 +71,7 @@ GNUNET_MY_exec_prepared (struct GNUNET_MYSQL_Context *mc,
71 } 71 }
72 off += p->num_params; 72 off += p->num_params;
73 } 73 }
74 stmt = GNUNET_MYSQL_statement_get_stmt (mc, sh); 74 stmt = GNUNET_MYSQL_statement_get_stmt (sh);
75 if (mysql_stmt_bind_param (stmt, 75 if (mysql_stmt_bind_param (stmt,
76 qbind)) 76 qbind))
77 { 77 {
@@ -142,7 +142,7 @@ GNUNET_MY_extract_result (struct GNUNET_MYSQL_StatementHandle *sh,
142 int ret; 142 int ret;
143 MYSQL_STMT *stmt; 143 MYSQL_STMT *stmt;
144 144
145 stmt = GNUNET_MYSQL_statement_get_stmt (NULL, sh); 145 stmt = GNUNET_MYSQL_statement_get_stmt (sh);
146 if (NULL == stmt) 146 if (NULL == stmt)
147 { 147 {
148 GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "mysql", 148 GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "mysql",
@@ -209,6 +209,7 @@ GNUNET_MY_extract_result (struct GNUNET_MYSQL_StatementHandle *sh,
209 __FILE__, __LINE__, 209 __FILE__, __LINE__,
210 mysql_stmt_error (stmt)); 210 mysql_stmt_error (stmt));
211 GNUNET_MY_cleanup_result (rs); 211 GNUNET_MY_cleanup_result (rs);
212 mysql_stmt_free_result (stmt);
212 return GNUNET_SYSERR; 213 return GNUNET_SYSERR;
213 } 214 }
214 field_off = 0; 215 field_off = 0;
@@ -227,12 +228,14 @@ GNUNET_MY_extract_result (struct GNUNET_MYSQL_StatementHandle *sh,
227 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 228 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
228 "Post-conversion for MySQL result failed at offset %u\n", 229 "Post-conversion for MySQL result failed at offset %u\n",
229 i); 230 i);
231 mysql_stmt_free_result (stmt);
230 GNUNET_MY_cleanup_result (rs); 232 GNUNET_MY_cleanup_result (rs);
231 return GNUNET_SYSERR; 233 return GNUNET_SYSERR;
232 } 234 }
233 field_off += rp->num_fields; 235 field_off += rp->num_fields;
234 } 236 }
235 } 237 }
238 mysql_stmt_free_result (stmt);
236 return GNUNET_OK; 239 return GNUNET_OK;
237} 240}
238 241