qemu-e2k/tests
Gan Qixin 73624e04a5 npcm7xx_adc-test: Fix memleak in adc_qom_set
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>
2021-01-19 15:45:14 +00:00
..
acceptance tests/acceptance: Fix race conditions in s390x tests & skip fedora on gitlab-CI 2021-01-11 14:59:21 +01:00
data acpi: Update _DSM method in expected files 2021-01-17 06:42:54 -05:00
decode decodetree: Improve identifier matching 2020-09-14 14:23:19 +01:00
docker docker: expand debian-amd64 image to include tag tools 2021-01-18 10:04:31 +00:00
fp tests/fp: Do not emit implicit-fallthrough warnings in the softfloat tests 2020-12-18 09:14:23 +01:00
guest-debug gdbstub: implement a softmmu based test 2021-01-18 10:04:31 +00:00
image-fuzzer image-fuzzer: Use OSerror.strerror instead of tuple subscript 2019-11-05 16:36:11 +01:00
include tests: add missing generated sources to testqapi 2020-10-17 10:45:50 -04:00
keys tests/vm: Add Haiku test based on their vagrant images 2020-11-17 09:45:24 +01:00
migration Remove the deprecated -realtime option 2020-12-15 12:52:02 -05:00
multiboot Remove superfluous .gitignore files 2020-10-13 12:48:17 +02:00
perf/block/qcow2
plugin plugin: Fixes compiling errors on msys2/mingw 2020-10-09 17:27:55 +01:00
qapi-schema meson: move SPHINX_ARGS references within "if build_docs" 2020-10-17 10:45:52 -04:00
qemu-iotests tests/iotests: drop test 312 from auto group 2021-01-06 17:30:02 +00:00
qtest npcm7xx_adc-test: Fix memleak in adc_qom_set 2021-01-19 15:45:14 +00:00
rocker
tcg target/arm: use official org.gnu.gdb.aarch64.sve layout for registers 2021-01-18 10:05:06 +00:00
tsan tests/docker: Added docker build support for TSan. 2020-06-16 14:49:05 +01:00
uefi-test-tools Remove superfluous .gitignore files 2020-10-13 12:48:17 +02:00
vm tests/docker, tests/vm: remove setuptools from images 2020-11-25 12:50:48 -05:00
vmstate-static-checker-data
Makefile.include build: replace ninjatool with ninja 2020-10-17 10:45:51 -04:00
atomic64-bench.c qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
atomic_add-bench.c qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
benchmark-crypto-cipher.c tests: fix output message formatting for crypto benchmarks 2020-09-10 11:02:17 +01:00
benchmark-crypto-hash.c tests: fix output message formatting for crypto benchmarks 2020-09-10 11:02:17 +01:00
benchmark-crypto-hmac.c tests: fix output message formatting for crypto benchmarks 2020-09-10 11:02:17 +01:00
check-block-qdict.c tests: Use error_free_or_abort() where appropriate 2020-07-02 06:25:28 +02:00
check-block.sh check-block: enable iotests with cfi-icall 2021-01-02 21:03:36 +01:00
check-qdict.c
check-qjson.c qobject: Drop qstring_get_try_str() 2020-12-19 10:39:16 +01:00
check-qlist.c qobject: Eliminate qlist_iter(), use QLIST_FOREACH_ENTRY() instead 2020-04-30 06:51:15 +02:00
check-qlit.c
check-qnull.c
check-qnum.c qobject: Fix qnum_to_string() to use sufficient precision 2020-12-19 10:37:16 +01:00
check-qobject.c qobject: Make QString immutable 2020-12-19 10:39:41 +01:00
check-qom-interface.c Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
check-qom-proplist.c qom: Clean up object_property_get_enum()'s error value 2020-09-18 13:49:48 -04:00
check-qstring.c qobject: Make QString immutable 2020-12-19 10:39:41 +01:00
crypto-tls-psk-helpers.c
crypto-tls-psk-helpers.h
crypto-tls-x509-helpers.c crypto: use a stronger private key for tests 2020-07-17 14:20:57 +02:00
crypto-tls-x509-helpers.h
dbus-vmstate-daemon.sh tests: add dbus-vmstate-test 2020-01-06 18:41:32 +04:00
io-channel-helpers.c test: Fix LGPL information in the file headers 2020-11-15 17:04:40 +01:00
io-channel-helpers.h test: Fix LGPL information in the file headers 2020-11-15 17:04:40 +01:00
iothread.c qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
iothread.h
meson.build meson: Propagate gnutls dependency 2021-01-12 12:38:03 +01:00
pkix_asn1_tab.c
ptimer-test-stubs.c replay: do not build if TCG is not available 2020-10-22 11:53:54 -04:00
ptimer-test.c tests/ptimer: Remove unnecessary inclusion of libqtest.h 2020-01-12 11:42:40 +01:00
ptimer-test.h
qht-bench.c qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
rcutorture.c qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
requirements.txt tests/acceptance: Bump avocado requirements to 83.0 2020-12-18 12:25:42 +01:00
socket-helpers.c tests/socket-helpers: Treat EAI_NONAME as EADDRNOTAVAIL 2020-09-16 08:41:06 +02:00
socket-helpers.h
test-aio-multithread.c qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
test-aio.c util/async: make bh_aio_poll() O(1) 2020-02-22 08:26:47 +00:00
test-authz-list.c authz: Fix Lesser GPL version number 2020-10-29 09:57:37 +00:00
test-authz-listfile.c authz: Fix Lesser GPL version number 2020-10-29 09:57:37 +00:00
test-authz-pam.c authz: Fix Lesser GPL version number 2020-10-29 09:57:37 +00:00
test-authz-simple.c authz: Fix Lesser GPL version number 2020-10-29 09:57:37 +00:00
test-base64.c test: Fix LGPL information in the file headers 2020-11-15 17:04:40 +01:00
test-bdrv-drain.c block: End quiescent sections when a BDS is deleted 2020-10-27 15:26:20 +01:00
test-bdrv-graph-mod.c tests: Use error_free_or_abort() where appropriate 2020-07-02 06:25:28 +02:00
test-bitcnt.c
test-bitmap.c mingw: fix error __USE_MINGW_ANSI_STDIO redefined 2020-10-13 13:33:46 +02:00
test-bitops.c
test-block-backend.c
test-block-iothread.c tests: Use error_free_or_abort() where appropriate 2020-07-02 06:25:28 +02:00
test-blockjob-txn.c
test-blockjob.c job: take each job's lock individually in job_txn_apply 2020-04-07 14:34:47 +02:00
test-bufferiszero.c test: Fix LGPL information in the file headers 2020-11-15 17:04:40 +01:00
test-char.c tests/test-char.c: Wait for the chardev to connect in char_socket_client_dupid_test 2021-01-13 10:21:17 +01:00
test-clone-visitor.c qapi: Use QAPI_LIST_PREPEND() where possible 2020-12-19 10:20:14 +01:00
test-coroutine.c
test-crypto-afsplit.c crypt: Fix Lesser GPL version number 2020-10-29 09:57:37 +00:00
test-crypto-block.c crypt: Fix Lesser GPL version number 2020-10-29 09:57:37 +00:00
test-crypto-cipher.c crypt: Fix Lesser GPL version number 2020-10-29 09:57:37 +00:00
test-crypto-hash.c crypt: Fix Lesser GPL version number 2020-10-29 09:57:37 +00:00
test-crypto-hmac.c
test-crypto-ivgen.c crypt: Fix Lesser GPL version number 2020-10-29 09:57:37 +00:00
test-crypto-pbkdf.c test: Fix LGPL information in the file headers 2020-11-15 17:04:40 +01:00
test-crypto-secret.c crypt: Fix Lesser GPL version number 2020-10-29 09:57:37 +00:00
test-crypto-tlscredsx509.c glib: use portable g_setenv() 2019-12-17 09:05:23 +01:00
test-crypto-tlssession.c glib: use portable g_setenv() 2019-12-17 09:05:23 +01:00
test-crypto-xts.c crypt: Fix Lesser GPL version number 2020-10-29 09:57:37 +00:00
test-cutils.c
test-fdmon-epoll.c tests: add test-fdmon-epoll 2020-09-23 13:45:52 +01:00
test-hbitmap.c block/dirty-bitmap: improve _next_dirty_area API 2020-03-18 14:03:46 -04:00
test-image-locking.c
test-int128.c
test-io-channel-buffer.c io: Fix Lesser GPL version number 2020-10-29 09:57:37 +00:00
test-io-channel-command.c io: Fix Lesser GPL version number 2020-10-29 09:57:37 +00:00
test-io-channel-file.c io: Fix Lesser GPL version number 2020-10-29 09:57:37 +00:00
test-io-channel-socket.c io: Fix Lesser GPL version number 2020-10-29 09:57:37 +00:00
test-io-channel-tls.c glib: use portable g_setenv() 2019-12-17 09:05:23 +01:00
test-io-task.c io: Fix Lesser GPL version number 2020-10-29 09:57:37 +00:00
test-iov.c util/iov: add iov_discard_undo() 2020-09-23 13:41:58 +01:00
test-keyval.c keyval: Parse help options 2020-10-15 16:06:27 +02:00
test-logging.c qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
test-mul64.c
test-opts-visitor.c
test-qapi-util.c
test-qdev-global-props.c tests: Fixes test-qdev-global-props.c 2020-09-16 12:15:07 +02:00
test-qdist.c
test-qemu-opts.c qemu-option: restrict qemu_opts_set to merge-lists QemuOpts 2020-12-10 12:15:12 -05:00
test-qga.c test-qga: fix a resource leak in test_qga_guest_get_osinfo() 2020-12-09 08:04:34 +01:00
test-qgraph.c test: Fix LGPL information in the file headers 2020-11-15 17:04:40 +01:00
test-qht-par.c
test-qht.c
test-qmp-cmds.c qapi: Add a 'coroutine' flag for commands 2020-10-09 07:08:19 +02:00
test-qmp-event.c tests/test-qmp-event: Check event is actually emitted 2020-03-17 19:58:34 +01:00
test-qobject-input-visitor.c qapi: enable use of g_autoptr with QAPI types 2020-09-03 09:38:36 +02:00
test-qobject-output-visitor.c qapi: Use QAPI_LIST_PREPEND() where possible 2020-12-19 10:20:14 +01:00
test-rcu-list.c qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
test-rcu-simpleq.c
test-rcu-slist.c rcu_queue: add QSLIST functions 2020-02-22 08:26:47 +00:00
test-rcu-tailq.c
test-replication.c tests: test-replication disable /replication/secondary/* on msys2/mingw. 2020-09-16 08:41:06 +02:00
test-shift128.c
test-string-input-visitor.c tests: Use &error_abort where appropriate 2020-07-02 06:25:28 +02:00
test-string-output-visitor.c string-output-visitor: Fix to use sufficient precision 2020-12-19 10:37:16 +01:00
test-thread-pool.c qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
test-throttle.c
test-timed-average.c cpu-timers, icount: new modules 2020-10-05 16:41:22 +02:00
test-util-filemonitor.c tests: Fixes building test-util-filemonitor.c on msys2/mingw 2020-09-07 12:34:17 +02:00
test-util-sockets.c sockets: Make abstract UnixSocketAddress depend on CONFIG_LINUX 2020-11-03 13:17:25 +00:00
test-uuid.c test: Fix LGPL information in the file headers 2020-11-15 17:04:40 +01:00
test-visitor-serialization.c qobject: Change qobject_to_json()'s value to GString 2020-12-19 10:38:43 +01:00
test-vmstate.c vmstate: Fixes test-vmstate.c on msys2/mingw 2020-09-16 08:41:06 +02:00
test-write-threshold.c block: introduce BDRV_MAX_LENGTH 2020-12-11 17:52:40 +01:00
test-x86-cpuid.c Revert "hw/i386: Update structures to save the number of nodes per package" 2020-09-02 07:29:26 -04:00
test-xbzrle.c
vhost-user-bridge.c libvhost-user: make it a meson subproject 2020-12-08 13:48:58 -05:00