73624e04a5
The adc_qom_set function didn't free "response", which caused an indirect memory leak. So use qobject_unref() to fix it. ASAN shows memory leak stack: Indirect leak of 593280 byte(s) in 144 object(s) allocated from: #0 0x7f9a5e7e8d4e in __interceptor_calloc (/lib64/libasan.so.5+0x112d4e) #1 0x7f9a5e607a50 in g_malloc0 (/lib64/libglib-2.0.so.0+0x55a50) #2 0x55b1bebf636b in qdict_new ../qobject/qdict.c:30 #3 0x55b1bec09699 in parse_object ../qobject/json-parser.c:318 #4 0x55b1bec0b2df in parse_value ../qobject/json-parser.c:546 #5 0x55b1bec0b6a9 in json_parser_parse ../qobject/json-parser.c:580 #6 0x55b1bec060d1 in json_message_process_token ../qobject/json-streamer.c:92 #7 0x55b1bec16a12 in json_lexer_feed_char ../qobject/json-lexer.c:313 #8 0x55b1bec16fbd in json_lexer_feed ../qobject/json-lexer.c:350 #9 0x55b1bec06453 in json_message_parser_feed ../qobject/json-streamer.c:121 #10 0x55b1bebc2d51 in qmp_fd_receive ../tests/qtest/libqtest.c:614 #11 0x55b1bebc2f5e in qtest_qmp_receive_dict ../tests/qtest/libqtest.c:636 #12 0x55b1bebc2e6c in qtest_qmp_receive ../tests/qtest/libqtest.c:624 #13 0x55b1bebc3340 in qtest_vqmp ../tests/qtest/libqtest.c:715 #14 0x55b1bebc3942 in qtest_qmp ../tests/qtest/libqtest.c:756 #15 0x55b1bebbd64a in adc_qom_set ../tests/qtest/npcm7xx_adc-test.c:127 #16 0x55b1bebbd793 in adc_write_input ../tests/qtest/npcm7xx_adc-test.c:140 #17 0x55b1bebbdf92 in test_convert_external ../tests/qtest/npcm7xx_adc-test.c:246 Reported-by: Euler Robot <euler.robot@huawei.com> Signed-off-by: Gan Qixin <ganqixin@huawei.com> Reviewed-by: Hao Wu <wuhaotsh@google.com> Message-id: 20210118065627.79903-1-ganqixin@huawei.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
||
---|---|---|
.. | ||
acceptance | ||
data | ||
decode | ||
docker | ||
fp | ||
guest-debug | ||
image-fuzzer | ||
include | ||
keys | ||
migration | ||
multiboot | ||
perf/block/qcow2 | ||
plugin | ||
qapi-schema | ||
qemu-iotests | ||
qtest | ||
rocker | ||
tcg | ||
tsan | ||
uefi-test-tools | ||
vm | ||
vmstate-static-checker-data | ||
atomic64-bench.c | ||
atomic_add-bench.c | ||
benchmark-crypto-cipher.c | ||
benchmark-crypto-hash.c | ||
benchmark-crypto-hmac.c | ||
check-block-qdict.c | ||
check-block.sh | ||
check-qdict.c | ||
check-qjson.c | ||
check-qlist.c | ||
check-qlit.c | ||
check-qnull.c | ||
check-qnum.c | ||
check-qobject.c | ||
check-qom-interface.c | ||
check-qom-proplist.c | ||
check-qstring.c | ||
crypto-tls-psk-helpers.c | ||
crypto-tls-psk-helpers.h | ||
crypto-tls-x509-helpers.c | ||
crypto-tls-x509-helpers.h | ||
dbus-vmstate-daemon.sh | ||
io-channel-helpers.c | ||
io-channel-helpers.h | ||
iothread.c | ||
iothread.h | ||
Makefile.include | ||
meson.build | ||
pkix_asn1_tab.c | ||
ptimer-test-stubs.c | ||
ptimer-test.c | ||
ptimer-test.h | ||
qht-bench.c | ||
rcutorture.c | ||
requirements.txt | ||
socket-helpers.c | ||
socket-helpers.h | ||
test-aio-multithread.c | ||
test-aio.c | ||
test-authz-list.c | ||
test-authz-listfile.c | ||
test-authz-pam.c | ||
test-authz-simple.c | ||
test-base64.c | ||
test-bdrv-drain.c | ||
test-bdrv-graph-mod.c | ||
test-bitcnt.c | ||
test-bitmap.c | ||
test-bitops.c | ||
test-block-backend.c | ||
test-block-iothread.c | ||
test-blockjob-txn.c | ||
test-blockjob.c | ||
test-bufferiszero.c | ||
test-char.c | ||
test-clone-visitor.c | ||
test-coroutine.c | ||
test-crypto-afsplit.c | ||
test-crypto-block.c | ||
test-crypto-cipher.c | ||
test-crypto-hash.c | ||
test-crypto-hmac.c | ||
test-crypto-ivgen.c | ||
test-crypto-pbkdf.c | ||
test-crypto-secret.c | ||
test-crypto-tlscredsx509.c | ||
test-crypto-tlssession.c | ||
test-crypto-xts.c | ||
test-cutils.c | ||
test-fdmon-epoll.c | ||
test-hbitmap.c | ||
test-image-locking.c | ||
test-int128.c | ||
test-io-channel-buffer.c | ||
test-io-channel-command.c | ||
test-io-channel-file.c | ||
test-io-channel-socket.c | ||
test-io-channel-tls.c | ||
test-io-task.c | ||
test-iov.c | ||
test-keyval.c | ||
test-logging.c | ||
test-mul64.c | ||
test-opts-visitor.c | ||
test-qapi-util.c | ||
test-qdev-global-props.c | ||
test-qdist.c | ||
test-qemu-opts.c | ||
test-qga.c | ||
test-qgraph.c | ||
test-qht-par.c | ||
test-qht.c | ||
test-qmp-cmds.c | ||
test-qmp-event.c | ||
test-qobject-input-visitor.c | ||
test-qobject-output-visitor.c | ||
test-rcu-list.c | ||
test-rcu-simpleq.c | ||
test-rcu-slist.c | ||
test-rcu-tailq.c | ||
test-replication.c | ||
test-shift128.c | ||
test-string-input-visitor.c | ||
test-string-output-visitor.c | ||
test-thread-pool.c | ||
test-throttle.c | ||
test-timed-average.c | ||
test-util-filemonitor.c | ||
test-util-sockets.c | ||
test-uuid.c | ||
test-visitor-serialization.c | ||
test-vmstate.c | ||
test-write-threshold.c | ||
test-x86-cpuid.c | ||
test-xbzrle.c | ||
vhost-user-bridge.c |