get_arg_type2: free inArgTypes before returning
Fix wrong strncpy sizes, detected by coverity

in strncpy, the size should be 1 less than the size of the buffer or we might get a string not null-terminated
More coverity resource leaks fixing