If I have a pointer to a struct and I call a function which returns a pointer to a struct that already has memory allocated to it, do I need to allocate the memory for the original variable? consider the follwoing pseudocode...
is this ok?Code:main function { structure pointer s_ptr; s_ptr = some_function() } structure pointer some_function { structure pointer s_ptr_temp; s_ptr_temp = malloc(yadda yadda); return s_ptr_temp; }