chapel-lang/chapel — pull request #819 by hildeth (2014-11-12 22:50:04+00:00)
Title: Add robustness by nulling out c_string_copy arguments.

By convention, a function receiving a c_string_copy as an argument should take ownership of that c_string_copy, either freeing it storing it or returning it. In any case, once ownership of a c_string_copy has been transferred, the former owner should not attempt to access it further. This can be enforced by passing the c_string_copy argument by reference and setting the original pointer to NULL inside the called routine.

This patch takes care of the change for string_from_c_string_copy and chpl_rt_free_c_string(_copy).