]> xenbits.xensource.com Git - libvirt.git/commit
util: json: Don't copy string in virJSONValueNewString
authorPeter Krempa <pkrempa@redhat.com>
Mon, 20 Dec 2021 13:52:13 +0000 (14:52 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 22 Dec 2021 12:48:35 +0000 (13:48 +0100)
commita8b4a41731bc33674efebd7ccee700aaa6b2e38b
tree41702923364b16d9b64cf7a02adbb391661b9633
parentf668e17bea725e242ba7d73d33df580d1dd1139a
util: json: Don't copy string in virJSONValueNewString

With 'g_strdup' not needing error handling we can ask callers to pass a
copy of the string which will be adopted by the JSON value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
src/util/virjson.c
src/util/virjson.h
tests/virjsontest.c