]> git.ipfire.org Git - thirdparty/libvirt.git/commit
libxl: eliminate extra copy of string
authorLaine Stump <laine@redhat.com>
Sun, 5 Jul 2020 03:43:52 +0000 (23:43 -0400)
committerLaine Stump <laine@redhat.com>
Wed, 8 Jul 2020 20:35:18 +0000 (16:35 -0400)
commit84fddfed45a2aadb06ba525f54de5dfd5834d44a
treef9341f248923f9e38c04903f08a0d290ae063b32
parent065f7d5ba9999edd16332b381139dbca1ebae140
libxl: eliminate extra copy of string

libxlMakeNic was calling g_strdup(virBufferCurrentContent(&buf)) to
make a copy of the buffer contents, and then later freeing the buffer
without ever using it again. Instead of this extra strdup, just
transfer ownership of the virBuffer's string with
virBufferContentAndReset(), and be done with it.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/libxl/libxl_conf.c