Skip to content

Commit

Permalink
- fixed double free when building insert fails (in buffered insert mode)
Browse files Browse the repository at this point in the history
  Reported by Brett Nemeroff
  • Loading branch information
bogdan-iancu committed Sep 25, 2013
1 parent 743f48e commit 7a3ef04
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion db/db_query.c
Expand Up @@ -246,8 +246,10 @@ int db_do_insert(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v,

/* if we have a PS, leave the function handling prep stmts
in the module to free the rows once it's done */
if (!CON_HAS_PS(_h))
if (!CON_HAS_PS(_h)) {
shm_free(buffered_rows[i]);
buffered_rows[i] = NULL;
}
}

if (off + 1 > SQL_BUF_LEN) goto error0;
Expand Down

0 comments on commit 7a3ef04

Please sign in to comment.