Avoid memory leaks on struct cmd_list_element.doc field.
authorPierre Muller <muller@sourceware.org>
Wed, 5 Dec 2012 23:23:22 +0000 (23:23 +0000)
committerPierre Muller <muller@sourceware.org>
Wed, 5 Dec 2012 23:23:22 +0000 (23:23 +0000)
commit5bc81a00b656522351c5970a4e7546e9b68870a1
tree4b6e39064f76d1eb399f55b75c5021d249afec47
parentad288036a73ad7fa77b75522c3e06eaef70b2e57
Avoid memory leaks on struct cmd_list_element.doc field.
* cli/cli-decode.c (add_alias_cmd): Make a copy of doc field
if flags contains DOC_ALLOCATED.
(add_setshow_cmd_full): Add DOC_ALLOCATED to set and show
flags.
(delete_cmd): Handle DOC_ALLOCATED flag.
* cli/cli-decode.h (DOC_ALLOCATED): New macro for use
in flags filed of struct cmd_list_element.
(struct cmd_list_element): Document new flag item.
gdb/ChangeLog
gdb/cli/cli-decode.c
gdb/cli/cli-decode.h