]> git.ipfire.org Git - thirdparty/knot-resolver.git/commit
daemon/http: fix memleak if http_write_pkt() fails obs-knot-resolver-8xyvhu/deployments/1556
authorTomas Krizek <tomas.krizek@nic.cz>
Tue, 30 Mar 2021 17:24:08 +0000 (19:24 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Wed, 31 Mar 2021 15:42:54 +0000 (17:42 +0200)
commitf9757a27b53f5855aec7a93c7cd4c6343c3e431d
treed5f885277092dd572e4b58cb2d75ae407600f723
parentd7260837e4b218a6fb2353fe6e597dc71c742c06
daemon/http: fix memleak if http_write_pkt() fails

This can happen for example when we want to send an answer, but the
http stream (or the connection?) is already closed.

Direct leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7f5ad2445459 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x55c0db3fc442 in http_write_pkt ../daemon/http.c:610
    #2 0x55c0db3fc882 in http_write ../daemon/http.c:651
    #3 0x55c0db3e9bb1 in qr_task_send ../daemon/worker.c:700
    #4 0x55c0db3ee86c in qr_task_finalize ../daemon/worker.c:1321
    #5 0x55c0db3f0123 in qr_task_step ../daemon/worker.c:1633
    #6 0x55c0db3f0982 in worker_submit ../daemon/worker.c:1755
    #7 0x55c0db3d992a in session_wirebuf_process ../daemon/session.c:759
    #8 0x55c0db3c5f01 in udp_recv ../daemon/io.c:89
    #9 0x7f5ad22b0e0e  (/usr/lib/libuv.so.1+0x20e0e)
daemon/http.c