mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 17:18:24 +08:00
Avoid double free in startup_inferior
Do not free the last execd pathname as it will be used in prepare_resume_reply(), after attaching a client side. gdb/ChangeLog: * fork-inferior.c (startup_inferior): Avoid double free.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2020-09-10 Kamil Rytarowski <n54@gmx.com>
|
||||||
|
|
||||||
|
* fork-inferior.c (startup_inferior): Avoid double free.
|
||||||
|
|
||||||
2020-09-10 Kamil Rytarowski <n54@gmx.com>
|
2020-09-10 Kamil Rytarowski <n54@gmx.com>
|
||||||
|
|
||||||
* netbsd-nat.h (netbsd_nat::qxfer_siginfo): Add.
|
* netbsd-nat.h (netbsd_nat::qxfer_siginfo): Add.
|
||||||
|
@ -526,7 +526,10 @@ startup_inferior (process_stratum_target *proc_target, pid_t pid, int ntraps,
|
|||||||
|
|
||||||
case TARGET_WAITKIND_EXECD:
|
case TARGET_WAITKIND_EXECD:
|
||||||
/* Handle EXEC signals as if they were SIGTRAP signals. */
|
/* Handle EXEC signals as if they were SIGTRAP signals. */
|
||||||
xfree (ws.value.execd_pathname);
|
/* Free the exec'ed pathname, but only if this isn't the
|
||||||
|
waitstatus we are returning to the caller. */
|
||||||
|
if (pending_execs != 1)
|
||||||
|
xfree (ws.value.execd_pathname);
|
||||||
resume_signal = GDB_SIGNAL_TRAP;
|
resume_signal = GDB_SIGNAL_TRAP;
|
||||||
switch_to_thread (proc_target, event_ptid);
|
switch_to_thread (proc_target, event_ptid);
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user