Skip to content

Commit

Permalink
fix codeql warnings (#10)
Browse files Browse the repository at this point in the history
* fix codeql warnings

* Update src/statement.h

Co-authored-by: Robo <hop2deep@gmail.com>

Co-authored-by: Robo <hop2deep@gmail.com>
  • Loading branch information
sbatten and deepak1556 committed Nov 16, 2021
1 parent a675471 commit 7112bf8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/statement.cc
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,10 @@ void Statement::GetRow(Row* row, sqlite3_stmt* stmt) {
for (int i = 0; i < rows; i++) {
int type = sqlite3_column_type(stmt, i);
const char* name = sqlite3_column_name(stmt, i);
if (name == NULL) {
assert(false);
}

switch (type) {
case SQLITE_INTEGER: {
row->push_back(new Values::Integer(name, sqlite3_column_int64(stmt, i)));
Expand Down
2 changes: 1 addition & 1 deletion src/statement.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Statement : public Napi::ObjectWrap<Statement> {
callback.Reset(cb_, 1);
}
virtual ~Baton() {
for (unsigned int i = 0; i < parameters.size(); i++) {
for (size_t i = 0; i < parameters.size(); i++) {
Values::Field* field = parameters[i];
DELETE_FIELD(field);
}
Expand Down

0 comments on commit 7112bf8

Please sign in to comment.