]> git.ipfire.org Git - thirdparty/qemu.git/commit
slirp: fix leak
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 3 May 2017 22:38:45 +0000 (02:38 +0400)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sat, 27 May 2017 21:34:47 +0000 (23:34 +0200)
commit7d8246960e03dabf37726c01d231e89dfde9b229
tree557b855d3213469ba9319339b2c48a9d205e0b0b
parentc7990a26480032ad129f8c4ddad7d9a132c934ca
slirp: fix leak

Spotted by ASAN:

/x86_64/hmp/pc-0.12:
=================================================================
==22538==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 224 byte(s) in 1 object(s) allocated from:
    #0 0x7f0f63cdee60 in malloc (/lib64/libasan.so.3+0xc6e60)
    #1 0x556f11ff32d7 in tcp_newtcpcb /home/elmarco/src/qemu/slirp/tcp_subr.c:250
    #2 0x556f11fdb1d1 in tcp_listen /home/elmarco/src/qemu/slirp/socket.c:688
    #3 0x556f11fca9d5 in slirp_add_hostfwd /home/elmarco/src/qemu/slirp/slirp.c:1052
    #4 0x556f11f8db41 in slirp_hostfwd /home/elmarco/src/qemu/net/slirp.c:506
    #5 0x556f11f8dd83 in hmp_hostfwd_add /home/elmarco/src/qemu/net/slirp.c:535

There might be a better way to fix this, but calling slirp tcp_close()
doesn't work.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
slirp/socket.c