wrap calls to malloc and free and add some padding around either side