malloc ref needed

This was needed to make `./build_ext` work for me. Not sure why it worked for you without. Also, I didn't really checked but was curios why I didn't need `free`.