Adding test for memory alloc inside functions