Instead of using strncpy, use ast_copy_string. Also, in the case of copying a