qemu-e2k/include/qemu
Marc-André Lureau e5dc1a6c6c readline: add a free function
Fixes leaks such as:

Direct leak of 2 byte(s) in 1 object(s) allocated from:
    #0 0x7eff58beb850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7eff57942f0c in g_malloc ../glib/gmem.c:94
    #2 0x7eff579431cf in g_malloc_n ../glib/gmem.c:331
    #3 0x7eff5795f6eb in g_strdup ../glib/gstrfuncs.c:363
    #4 0x55db720f1d46 in readline_hist_add /home/elmarco/src/qq/util/readline.c:258
    #5 0x55db720f2d34 in readline_handle_byte /home/elmarco/src/qq/util/readline.c:387
    #6 0x55db71539d00 in monitor_read /home/elmarco/src/qq/monitor.c:3896
    #7 0x55db71f9be35 in qemu_chr_be_write_impl /home/elmarco/src/qq/chardev/char.c:167
    #8 0x55db71f9bed3 in qemu_chr_be_write /home/elmarco/src/qq/chardev/char.c:179
    #9 0x55db71fa013c in fd_chr_read /home/elmarco/src/qq/chardev/char-fd.c:66
    #10 0x55db71fe18a8 in qio_channel_fd_source_dispatch /home/elmarco/src/qq/io/channel-watch.c:84
    #11 0x7eff5793a90b in g_main_dispatch ../glib/gmain.c:3182
    #12 0x7eff5793b7ac in g_main_context_dispatch ../glib/gmain.c:3847
    #13 0x55db720af3bd in glib_pollfds_poll /home/elmarco/src/qq/util/main-loop.c:214
    #14 0x55db720af505 in os_host_main_loop_wait /home/elmarco/src/qq/util/main-loop.c:261
    #15 0x55db720af6d6 in main_loop_wait /home/elmarco/src/qq/util/main-loop.c:515
    #16 0x55db7184e0de in main_loop /home/elmarco/src/qq/vl.c:1995
    #17 0x55db7185e956 in main /home/elmarco/src/qq/vl.c:4914
    #18 0x7eff4ea17039 in __libc_start_main (/lib64/libc.so.6+0x21039)

(while at it, use g_new0(ReadLineState), it's a bit easier to read)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20180104160523.22995-11-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2018-01-16 14:54:50 +01:00
..
acl.h
atomic.h memory: avoid "resurrection" of dead FlatViews 2017-09-21 23:19:37 +02:00
base64.h
bcd.h
bitmap.h bitmap: provide to_le/from_le helpers 2017-09-22 14:11:25 +02:00
bitops.h
bswap.h
buffer.h
compiler.h
config-file.h
coroutine_int.h coroutine: abort if we try to schedule or enter a pending coroutine 2017-11-21 11:58:07 -05:00
coroutine.h coroutine: simplify co_aio_sleep_ns() prototype 2017-12-19 09:25:27 +00:00
cpuid.h
crc32c.h
cutils.h
envlist.h
error-report.h
event_notifier.h
fifo8.h
fifo32.h
fprintf-fn.h
futex.h futex: add missing header guards 2017-10-16 20:57:13 +03:00
hbitmap.h hbitmap: add next_zero function 2017-12-18 10:54:13 -05:00
help_option.h
host-utils.h
id.h
int128.h
iov.h
jhash.h
log.h
main-loop.h
memfd.h
mmap-alloc.h
module.h
notify.h
option_int.h
option.h option: Drop unused get_param_value(), get_next_param_value() 2017-12-20 09:11:50 +01:00
osdep.h sparc: Make sure we mmap at SHMLBA alignment 2017-12-15 15:26:24 +00:00
path.h
processor.h
qdist.h
qht.h qht: fix kernel-doc markup in qht.h 2017-12-18 17:07:02 +03:00
queue.h tcg: Dynamically allocate TCGOps 2017-12-29 12:43:39 -08:00
range.h
ratelimit.h
rcu_queue.h
rcu.h
readline.h readline: add a free function 2018-01-16 14:54:50 +01:00
seqlock.h
sockets.h sockets: remove obsolete code that updated listen address 2017-12-21 09:22:44 +01:00
stats64.h
systemd.h
thread-posix.h thread-posix: fix qemu_rec_mutex_trylock macro 2017-11-14 14:31:33 +01:00
thread-win32.h
thread.h
throttle-options.h
throttle.h
timed-average.h
timer.h
typedefs.h i386: hvf: add code base from Google's QEMU repository 2017-12-22 15:01:20 +01:00
unicode.h
uri.h
uuid.h util: add is_equal to UUID API 2017-12-20 22:01:24 +08:00
xattr.h