This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Use delete instead of xfree for gdb_timer
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: <gdb-patches at sourceware dot org>
- Cc: Simon Marchi <simon dot marchi at ericsson dot com>
- Date: Wed, 31 May 2017 16:47:43 +0200
- Subject: [PATCH] Use delete instead of xfree for gdb_timer
- Authentication-results: sourceware.org; auth=none
- Authentication-results: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=ericsson.com;
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
gdb_timer objects are new'ed in create_timer, but xfree'd in
poll_timers. Use delete instead.
gdb/ChangeLog:
* event-loop.c (poll_timers): Unallocate timer using delete
instead of xfree.
---
gdb/event-loop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/event-loop.c b/gdb/event-loop.c
index 4b3ddb8..7304ca7 100644
--- a/gdb/event-loop.c
+++ b/gdb/event-loop.c
@@ -1270,7 +1270,7 @@ poll_timers (void)
/* Delete the timer before calling the callback, not after, in
case the callback itself decides to try deleting the timer
too. */
- xfree (timer_ptr);
+ delete timer_ptr;
/* Call the procedure associated with that timer. */
(proc) (client_data);
--
2.7.4