If we have a structure that has pointers to malloced memory and then if we free that structure, is the memory referenced by that structure also freed? or do we have to free it m
Its basically equals to number of malloc()s performed to allocate the memory. If you allocate memory dynamically using malloc() for both struct pointers fomResult & fomResult you should use separate two free() functions to free there memory along with freeing MResult.