Commits

Greg Ward committed 223d047

svn: do not ignore errors from sqlite3_step()

  • Participants
  • Parent commits 21b985a

Comments (0)

Files changed (1)

         goto err;
     }
     char *buf = malloc(1024);
-    sqlite3_step(res);
+    retval = sqlite3_step(res);
+    if (retval != SQLITE_DONE && retval != SQLITE_ROW) {
+        debug("error fetching result row");
+        goto err;
+    }
     sprintf(buf, "%s", sqlite3_column_text(res, 0));
     result->revision = buf;
     sqlite3_finalize(res);
         debug("error binding parameter");
         goto err;
     }
-    sqlite3_step(res);
+    retval = sqlite3_step(res);
+    if (retval != SQLITE_DONE && retval != SQLITE_ROW) {
+        debug("error fetching result row");
+        goto err;
+    }
+
     repos_path = strdup((const char *) sqlite3_column_text(res, 0));
     result->branch = get_branch_name(repos_path);