Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address some CodeQL warnings #1614

Merged
merged 1 commit into from Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/statement.cc
Expand Up @@ -840,6 +840,10 @@ void Statement::GetRow(Row* row, sqlite3_stmt* stmt) {
for (int i = 0; i < cols; 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
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