Free results of varobj_get_expression

varobj_get_expression returns an allocated string, which must be freed
by the caller.

gdb/ChangeLog:

	* mi-cmd-var.c (print_varobj): Free varobj_get_expression
	result.
	(mi_cmd_var_info_expression): Same.
	* varobj.c (varobj_get_expression): Mention in the comment that
	the result must by freed by the caller.
This commit is contained in:
Simon Marchi
2015-01-30 13:56:56 -05:00
parent afa269ae41
commit ca83fa8189
3 changed files with 21 additions and 3 deletions

View File

@@ -492,7 +492,8 @@ varobj_get_objname (struct varobj *var)
return var->obj_name;
}
/* Given the handle, return the expression represented by the object. */
/* Given the handle, return the expression represented by the object. The
result must be freed by the caller. */
char *
varobj_get_expression (struct varobj *var)