Skip to content

Commit

Permalink
Fixing memory leak if no more memory available for allocating columns
Browse files Browse the repository at this point in the history
  • Loading branch information
mariano committed Jun 3, 2011
1 parent 7e13d0a commit 0afd864
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/result.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ node_db_mysql::Result::Result(MYSQL* connection) throw(node_db::Exception&)

for (uint16_t i = 0; i < this->totalColumns; i++) {
this->columns[i] = new Column(fields[i]);
if (this->columns[i] == NULL) {
delete [] this->columns;
throw node_db::Exception("Could not allocate storage for column");
}
}
}

Expand Down

0 comments on commit 0afd864

Please sign in to comment.