mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 01:50:24 +08:00
gdbserver: QTNotes, plug memory leak.
The previous notes aren't being released before setting new ones. Tested on x86_64 Fedora 17. gdb/gdbserver/ 2013-02-14 Pedro Alves <palves@redhat.com> Plug memory leak. * tracepoint.c (cmd_qtnotes): Free TRACING_USER_NAME, TRACING_NOTES and TRACING_STOP_NOTE before clobbering.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
2013-02-14 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
|
Plug memory leak.
|
||||||
|
|
||||||
|
* tracepoint.c (cmd_qtnotes): Free TRACING_USER_NAME,
|
||||||
|
TRACING_NOTES and TRACING_STOP_NOTE before clobbering.
|
||||||
|
|
||||||
2013-02-14 Pedro Alves <palves@redhat.com>
|
2013-02-14 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
* tracepoint.c (cmd_qtdpsrc): Use savestring.
|
* tracepoint.c (cmd_qtdpsrc): Use savestring.
|
||||||
|
@ -4042,6 +4042,7 @@ cmd_qtnotes (char *own_buf)
|
|||||||
user[nbytes] = '\0';
|
user[nbytes] = '\0';
|
||||||
++packet; /* skip the semicolon */
|
++packet; /* skip the semicolon */
|
||||||
trace_debug ("User is '%s'", user);
|
trace_debug ("User is '%s'", user);
|
||||||
|
xfree (tracing_user_name);
|
||||||
tracing_user_name = user;
|
tracing_user_name = user;
|
||||||
}
|
}
|
||||||
else if (strncmp ("notes:", packet, strlen ("notes:")) == 0)
|
else if (strncmp ("notes:", packet, strlen ("notes:")) == 0)
|
||||||
@ -4055,6 +4056,7 @@ cmd_qtnotes (char *own_buf)
|
|||||||
notes[nbytes] = '\0';
|
notes[nbytes] = '\0';
|
||||||
++packet; /* skip the semicolon */
|
++packet; /* skip the semicolon */
|
||||||
trace_debug ("Notes is '%s'", notes);
|
trace_debug ("Notes is '%s'", notes);
|
||||||
|
xfree (tracing_notes);
|
||||||
tracing_notes = notes;
|
tracing_notes = notes;
|
||||||
}
|
}
|
||||||
else if (strncmp ("tstop:", packet, strlen ("tstop:")) == 0)
|
else if (strncmp ("tstop:", packet, strlen ("tstop:")) == 0)
|
||||||
@ -4068,6 +4070,7 @@ cmd_qtnotes (char *own_buf)
|
|||||||
stopnote[nbytes] = '\0';
|
stopnote[nbytes] = '\0';
|
||||||
++packet; /* skip the semicolon */
|
++packet; /* skip the semicolon */
|
||||||
trace_debug ("tstop note is '%s'", stopnote);
|
trace_debug ("tstop note is '%s'", stopnote);
|
||||||
|
xfree (tracing_stop_note);
|
||||||
tracing_stop_note = stopnote;
|
tracing_stop_note = stopnote;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user