diff options
author | Peter Krempa <pkrempa@redhat.com> | 2021-08-03 14:14:20 +0200 |
---|---|---|
committer | Peter Krempa <pkrempa@redhat.com> | 2021-08-06 08:53:25 +0200 |
commit | 98f6f2081d7be667bdae135f857e1e72d187a415 (patch) | |
tree | 8e9752479f3ab6b87d870d577ee35bcd058ced42 /src/util/virlog.c | |
parent | 8c22b28dbe1b5e8062869c58be129338760daa9a (diff) | |
download | libvirt-98f6f2081d7be667bdae135f857e1e72d187a415.tar.gz |
util: alloc: Reimplement VIR_APPEND_ELEMENT using virAppendElement
Use virAppendElement instead of virInsertElementsN to implement
VIR_APPEND_ELEMENT which allows us to remove error handling as the
only relevant errors were removed when switching to aborting memory
allocation functions.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Diffstat (limited to 'src/util/virlog.c')
-rw-r--r-- | src/util/virlog.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/util/virlog.c b/src/util/virlog.c index 3ad043d98a..ac35e36148 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -1638,10 +1638,7 @@ virLogParseOutputs(const char *src, virLogOutput ***outputs) * lose the old entry */ at = virLogFindOutput(list, noutputs, output->dest, output->name); - if (VIR_APPEND_ELEMENT(list, noutputs, output) < 0) { - virLogOutputFree(output); - return -1; - } + VIR_APPEND_ELEMENT(list, noutputs, output); if (at >= 0) { virLogOutputFree(list[at]); VIR_DELETE_ELEMENT(list, at, noutputs); @@ -1687,10 +1684,7 @@ virLogParseFilters(const char *src, virLogFilter ***filters) if (!(filter = virLogParseFilter(*next))) return -1; - if (VIR_APPEND_ELEMENT(list, nfilters, filter)) { - virLogFilterFree(filter); - return -1; - } + VIR_APPEND_ELEMENT(list, nfilters, filter); } *filters = g_steal_pointer(&list); |