Skip to content
Browse files

Fixing memory leak if no more memory available for allocating columns

  • Loading branch information...
1 parent a5b004e commit 14561dd848f9df58b09c87c4d23dd8aab4047ecf @mariano committed
Showing with 5 additions and 1 deletion.
  1. +1 −1 lib/node-db
  2. +4 −0 src/result.cc
2 lib/node-db
@@ -1 +1 @@
-Subproject commit 7ef22e6b8e7096be2bb5dfd54709fbfce8e17826
+Subproject commit 82ddda0843dc36d17085377cced1625a5b33c438
View
4 src/result.cc
@@ -88,6 +88,10 @@ node_db_drizzle::Result::Result(drizzle_st* drizzle, drizzle_result_st* result)
drizzle_column_st *current;
while ((current = drizzle_column_next(this->result)) != NULL) {
this->columns[i++] = new Column(current);
+ if (this->columns[i] == NULL) {
+ delete [] this->columns;
+ throw node_db::Exception("Could not allocate storage for column");
+ }
}
this->nextRow = this->row();

0 comments on commit 14561dd

Please sign in to comment.
Something went wrong with that request. Please try again.