fix allocation/deallocation mismatch

Issue(s) found via [cppcheck](http://cppcheck.sourceforge.net/).