fix new[]/delete mismatch

Found by Asan. Upstreamed Libreoffice patch.
Merge pull request #295 from mmohrhard/master

fix new[]/delete mismatch