mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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>
This commit is contained in:
parent
17dc579903
commit
348fbd5816
2 changed files with 5 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue