initialize some malloced memory

this creates memory corruptions in the lua branch, but is worth fixing in master