diff options
author | Philippe Waroquiers <philippe.waroquiers@skynet.be> | 2018-11-28 00:22:29 +0100 |
---|---|---|
committer | Philippe Waroquiers <philippe.waroquiers@skynet.be> | 2018-11-29 23:33:18 +0100 |
commit | 95b1f9ac6b7de84b09580bdf2456955bcff86da1 (patch) | |
tree | 7a4635b2ca80bc44d7a3fbe38c6f3c355e8c79b6 /gdb/test-target.c | |
parent | e61667ef1413b9fba1bb9dc78744329f8215de74 (diff) | |
download | gdb-95b1f9ac6b7de84b09580bdf2456955bcff86da1.zip gdb-95b1f9ac6b7de84b09580bdf2456955bcff86da1.tar.gz gdb-95b1f9ac6b7de84b09580bdf2456955bcff86da1.tar.bz2 |
Fix leak in forward-search
Valgrind reports the below leak.
Fix the leak by using xrealloc, even for the first allocation,
as buf is static.
==29158== 5,888 bytes in 23 blocks are definitely lost in loss record 3,028 of 3,149
==29158== at 0x4C2BE2D: malloc (vg_replace_malloc.c:299)
==29158== by 0x41B557: xmalloc (common-utils.c:44)
==29158== by 0x60B7D9: forward_search_command(char const*, int) (source.c:1563)
==29158== by 0x40BA68: cmd_func(cmd_list_element*, char const*, int) (cli-decode.c:1888)
==29158== by 0x665300: execute_command(char const*, int) (top.c:630)
...
gdb/ChangeLog
2018-11-29 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* source.c (forward_search_command): Fix leak by using
xrealloc even for the first allocation in the loop, as buf
is static.
Diffstat (limited to 'gdb/test-target.c')
0 files changed, 0 insertions, 0 deletions