]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: virerror: Avoid a copy of the error messages
authorPeter Krempa <pkrempa@redhat.com>
Thu, 25 Feb 2021 16:20:12 +0000 (17:20 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 5 Mar 2021 14:01:29 +0000 (15:01 +0100)
commit67a710c3c37a6b3d8f35abaa45ebfeadf59c82f7
treec6fea23759497c45dee5c149c427c6572c252c0c
parent34875547367d1472905a22c9f37537454fe3eaa4
util: virerror: Avoid a copy of the error messages

Some error message reporting functions already have allocated buffers
which were used to format the error message, so copying the strings is
redundant.

Extract the internals from 'virRaiseErrorFull' to
'virRaiseErrorInternal' which takes allocated strings as arguments and
steals them, so that callers can reuse the buffers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virerror.c