Use unique_xmalloc_ptr in remote.c
This removes a cleanup from remote.c, replacing it with unique_xmalloc_ptr. 2019-03-06 Tom Tromey <tom@tromey.com> * remote.c (remote_target::remote_parse_stop_reply): Use unique_xmalloc_ptr.
This commit is contained in:
parent
61b3009970
commit
c6321f19c5
2 changed files with 9 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2019-03-06 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* remote.c (remote_target::remote_parse_stop_reply): Use
|
||||||
|
unique_xmalloc_ptr.
|
||||||
|
|
||||||
2019-03-06 Tom Tromey <tom@tromey.com>
|
2019-03-06 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* stabsread.c (struct stabs_field_info): Rename from field_info.
|
* stabsread.c (struct stabs_field_info): Rename from field_info.
|
||||||
|
|
|
@ -7312,14 +7312,13 @@ Packet: '%s'\n"),
|
||||||
|
|
||||||
/* Save the pathname for event reporting and for
|
/* Save the pathname for event reporting and for
|
||||||
the next run command. */
|
the next run command. */
|
||||||
char *pathname = (char *) xmalloc (pathlen + 1);
|
gdb::unique_xmalloc_ptr<char[]> pathname
|
||||||
struct cleanup *old_chain = make_cleanup (xfree, pathname);
|
((char *) xmalloc (pathlen + 1));
|
||||||
hex2bin (p1, (gdb_byte *) pathname, pathlen);
|
hex2bin (p1, (gdb_byte *) pathname.get (), pathlen);
|
||||||
pathname[pathlen] = '\0';
|
pathname[pathlen] = '\0';
|
||||||
discard_cleanups (old_chain);
|
|
||||||
|
|
||||||
/* This is freed during event handling. */
|
/* This is freed during event handling. */
|
||||||
event->ws.value.execd_pathname = pathname;
|
event->ws.value.execd_pathname = pathname.release ();
|
||||||
event->ws.kind = TARGET_WAITKIND_EXECD;
|
event->ws.kind = TARGET_WAITKIND_EXECD;
|
||||||
|
|
||||||
/* Skip the registers included in this packet, since
|
/* Skip the registers included in this packet, since
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue