daemon/http: fix memleak if http_write_pkt() fails
- Apr 16, 2021
-
-
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)
-