Good and Bad ways of using functions that initialize variables/allocating/freeing their space with malloc