[libvirt] [PATCH 03/19] util: buffer: Simplify escape buffer allocations

Ján Tomko jtomko at redhat.com
Thu Oct 24 14:23:44 UTC 2019


On Thu, Oct 24, 2019 at 03:56:21PM +0200, Peter Krempa wrote:
>Replace combinations of xalloc_oversized and VIR_ALLOC_N_QUIET by using
>g_malloc0_n which does the checking internally.
>
>This conversion is done with a semantic difference and slightly higher
>memory requirements as I've opted to allocate one chunk more than
>necessary rather than trying to accomodate the NUL byte separately.
>
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> src/util/virbuffer.c | 19 ++++---------------
> 1 file changed, 4 insertions(+), 15 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20191024/9fd9f603/attachment-0001.sig>


More information about the libvir-list mailing list