the strlen() function relies on there being a '\0' termination character to mark the end of the string. You haven't put one in your variable 'test' so strlen() will keep going until it finds one somewhere in memory.
If you are trying to measure the size of the memory malloc'd it can't be done using standard library functions. You may be lucky in that your implementation has an extension to do it, otherwise you just have to track the size yourself.
No, you don't need to free argv at all so forget line 54 onwards. You should return 0 at the end of your main() as it is defined as returning an int.
free() releases the memory back to the stack after you've finished with it from making a malloc type call, see Dynamic memory Management on this link for more info http://www.cplusplus.com/reference/clibrary/cstdlib/