reset statement on error
authorChristian Grothoff <christian@grothoff.org>
Fri, 10 Mar 2017 10:12:47 +0000 (11:12 +0100)
committerChristian Grothoff <christian@grothoff.org>
Fri, 10 Mar 2017 10:12:47 +0000 (11:12 +0100)
src/sq/sq.c

index dc4416761b9aed0506a12e69b3048f2ae8e7ffcf..114de2d88fea3811cf63620614e5b3187d951af9 100644 (file)
@@ -49,7 +49,14 @@ GNUNET_SQ_bind (sqlite3_stmt *stmt,
                        "sq",
                        _("Failure to bind %u-th SQL parameter\n"),
                        i);
-      return GNUNET_SYSERR;
+      if (SQLITE_OK !=
+          sqlite3_reset (stmt))
+      {
+        GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING,
+                         "sq",
+                         _("Failure in sqlite3_reset (!)\n"));
+        return GNUNET_SYSERR;
+      }
     }
     GNUNET_assert (0 != params[i].num_params);
     j += params[i].num_params;