diff options
author | tony.nguyen@bt.com <tony.nguyen@bt.com> | 2019-06-08 05:25:52 +0000 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2019-08-21 10:27:13 +0200 |
commit | 348fbd5816cab30d38d7a3727a4b83404797128a (patch) | |
tree | 13f4a9c42f28f95e7a87d2e0da64f246b278b5b5 /tests/check-qjson.c | |
parent | 17dc57990320edaad52ac9ea808be9719c91cea6 (diff) | |
download | qemu-348fbd5816cab30d38d7a3727a4b83404797128a.zip qemu-348fbd5816cab30d38d7a3727a4b83404797128a.tar.gz qemu-348fbd5816cab30d38d7a3727a4b83404797128a.tar.bz2 |
test: Use g_strndup instead of plain strndup
Due to memory management rules. See HACKING.
Signed-off-by: Tony Nguyen <tony.nguyen@bt.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <dce313b46d294ada8826d34609a3447e@tpw09926dag18e.domain1.systemhost.net>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'tests/check-qjson.c')
-rw-r--r-- | tests/check-qjson.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/check-qjson.c b/tests/check-qjson.c index fa2afcc..07a773e 100644 --- a/tests/check-qjson.c +++ b/tests/check-qjson.c @@ -767,7 +767,7 @@ static void utf8_string(void) if (*end == ' ') { end++; } - in = strndup(tail, end - tail); + in = g_strndup(tail, end - tail); str = from_json_str(in, j, NULL); g_assert(!str); g_free(in); |