cppcheck: fix "Mismatching allocation and deallocation"

Change-Id: Ic007b07a82eb83978527254518d85c5a2903a48d
Reviewed-on: https://gerrit.libreoffice.org/9175
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>