smalloc: don't mix malloc() and new char[]
authorBen Noordhuis <info@bnoordhuis.nl>
Thu, 19 Mar 2015 12:35:47 +0000 (13:35 +0100)
committerBen Noordhuis <info@bnoordhuis.nl>
Thu, 19 Mar 2015 21:34:17 +0000 (22:34 +0100)
commit2034137385e8b77cf09a379efb0700f67b57e658
tree7e9ebaaf57b238d0ca4e319da2a8699c1d8603f3
parent465552142f16c6cd5603cde7a241c89ada808138
smalloc: don't mix malloc() and new char[]

It's technically undefined behavior to mix malloc with delete[] and
new char[] with free().  smalloc was using new char[] in one place and
malloc() in another but in both cases the memory was freed with free().

PR-URL: https://github.com/iojs/io.js/pull/1205
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
src/smalloc.cc