Anything you malloc
ed must be free
d as well. An exception would be when exiting, as usually the OS will claim the memory anyway (depends on the OS). Still it would be considered bad practice, even though it technically wouldn't be a memory leak.
The free should be done in the reverse order to what you usedin to allocate.
for(i = 0; i < a.var; i++) {
free(a.m[i]);
free(a.m);
Reason is, that you can not free the main body before you freed the pointers inside it, as they are not accessible anymore.