Message ID | 20190120182123.2223-1-philippe.waroquiers@skynet.be |
---|---|
State | New |
Headers | show |
>>>>> "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:
Philippe> 2019-01-20 Philippe Waroquiers <philippe.waroquiers@skynet.be>
Philippe> * event-top.c (handle_line_of_input): xfree history_value if
Philippe> no expansion occurred.
How about turning history_value into a unique_xmalloc_ptr,
then use .release in the final assignment from it?
That would eliminate another xfree and IMO be a bit more future-proof.
Tom
diff --git a/gdb/event-top.c b/gdb/event-top.c index 3d3d6275d7..93ea13e3ed 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -705,6 +705,8 @@ handle_line_of_input (struct buffer *cmd_line_buffer, cmd_line_buffer->buffer_size = len + 1; cmd = history_value; } + else + xfree (history_value); } /* If we just got an empty line, and that is supposed to repeat the