FYI: strdup() -> xstrdup()
Stan Shebs
shebs@cygnus.com
Mon Nov 22 13:40:00 GMT 1999
Date: Mon, 22 Nov 1999 20:32:10 +1100
From: Andrew Cagney <ac131313@cygnus.com>
I've checked in a patch with the ChangeLog entry:
Thu Nov 18 18:12:48 1999 Andrew Cagney <cagney@b1.cygnus.com>
* jv-typeprint.c (java_type_print_base), kod-cisco.c
(cisco_kod_open), kod.c (kod_set_os), xcoffread.c
(process_linenos), symfile.c (add_symbol_file_command),
remote-rdi.c (arm_rdi_open, rdilogfile_command), main.c
(captured_main), go32-nat.c (go32_create_inferior), exec.c
(exec_file_attach), corefile.c (core_file_command,
reopen_exec_file): Replace strdup with xstrdup.
None of the calls to strdup() were being checked. At least this gets
GDB to attempt a clean shutdown :-)
Good stuff! Could you perhaps add a note to the internals manual? Strdup
is a standard function, and a year from now somebody will forget about
xstrdup and use the standard function instead.
Stan
More information about the Gdb-patches
mailing list