[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PULL 5/5] monitor: fix oob command leak
From: |
Markus Armbruster |
Subject: |
[Qemu-stable] [PULL 5/5] monitor: fix oob command leak |
Date: |
Wed, 15 Aug 2018 09:13:08 +0200 |
From: Marc-André Lureau <address@hidden>
Spotted by ASAN, during make check...
Direct leak of 40 byte(s) in 1 object(s) allocated from:
#0 0x7f8e27262c48 in malloc (/lib64/libasan.so.5+0xeec48)
#1 0x7f8e26a5f3c5 in g_malloc (/lib64/libglib-2.0.so.0+0x523c5)
#2 0x555ab67078a8 in qstring_from_str
/home/elmarco/src/qq/qobject/qstring.c:67
#3 0x555ab67071e4 in qstring_new /home/elmarco/src/qq/qobject/qstring.c:24
#4 0x555ab6713fbf in qstring_from_escaped_str
/home/elmarco/src/qq/qobject/json-parser.c:144
#5 0x555ab671738c in parse_literal
/home/elmarco/src/qq/qobject/json-parser.c:506
#6 0x555ab67179c3 in parse_value
/home/elmarco/src/qq/qobject/json-parser.c:569
#7 0x555ab6715123 in parse_pair
/home/elmarco/src/qq/qobject/json-parser.c:306
#8 0x555ab6715483 in parse_object
/home/elmarco/src/qq/qobject/json-parser.c:357
#9 0x555ab671798b in parse_value
/home/elmarco/src/qq/qobject/json-parser.c:561
#10 0x555ab6717a6b in json_parser_parse_err
/home/elmarco/src/qq/qobject/json-parser.c:592
#11 0x555ab4fd4dcf in handle_qmp_command /home/elmarco/src/qq/monitor.c:4257
#12 0x555ab6712c4d in json_message_process_token
/home/elmarco/src/qq/qobject/json-streamer.c:105
#13 0x555ab67e01e2 in json_lexer_feed_char
/home/elmarco/src/qq/qobject/json-lexer.c:323
#14 0x555ab67e0af6 in json_lexer_feed
/home/elmarco/src/qq/qobject/json-lexer.c:373
#15 0x555ab6713010 in json_message_parser_feed
/home/elmarco/src/qq/qobject/json-streamer.c:124
#16 0x555ab4fd58ec in monitor_qmp_read /home/elmarco/src/qq/monitor.c:4337
#17 0x555ab6559df2 in qemu_chr_be_write_impl
/home/elmarco/src/qq/chardev/char.c:175
#18 0x555ab6559e95 in qemu_chr_be_write
/home/elmarco/src/qq/chardev/char.c:187
#19 0x555ab6560127 in fd_chr_read /home/elmarco/src/qq/chardev/char-fd.c:66
#20 0x555ab65d9c73 in qio_channel_fd_source_dispatch
/home/elmarco/src/qq/io/channel-watch.c:84
#21 0x7f8e26a598ac in g_main_context_dispatch
(/lib64/libglib-2.0.so.0+0x4c8ac)
Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
[Screwed up in commit b27314567d4]
Cc: address@hidden
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
---
monitor.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/monitor.c b/monitor.c
index 77861e96af..a1999e396c 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4277,6 +4277,8 @@ static void handle_qmp_command(JSONMessageParser *parser,
GQueue *tokens)
trace_monitor_qmp_cmd_out_of_band(qobject_get_try_str(id)
?: "");
monitor_qmp_dispatch(mon, req, id);
+ qobject_unref(req);
+ qobject_unref(id);
return;
}
--
2.17.1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-stable] [PULL 5/5] monitor: fix oob command leak,
Markus Armbruster <=