[PATCH 19/38] virlog: Make virLogReset methods use of virLog(Output|Filter)ListFree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Now that methods to free logging related lists were introduced, put them to a
use.
---
 src/util/virlog.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/src/util/virlog.c b/src/util/virlog.c
index a1f5872..7e0936c 100644
--- a/src/util/virlog.c
+++ b/src/util/virlog.c
@@ -239,11 +239,8 @@ virLogSetDefaultPriority(virLogPriority priority)
 static void
 virLogResetFilters(void)
 {
-    size_t i;
-
-    for (i = 0; i < virLogNbFilters; i++)
-        VIR_FREE(virLogFilters[i]->match);
-    VIR_FREE(virLogFilters);
+    virLogFilterListFree(virLogFilters, virLogNbFilters);
+    virLogFilters = NULL;
     virLogNbFilters = 0;
     virLogFiltersSerial++;
 }
@@ -321,12 +318,8 @@ virLogFilterNew(const char *match,
 static void
 virLogResetOutputs(void)
 {
-    size_t i;
-
-    for (i = 0; i < virLogNbOutputs; i++)
-        virLogOutputFree(virLogOutputs[i]);
-
-    VIR_FREE(virLogOutputs);
+    virLogOutputListFree(virLogOutputs, virLogNbOutputs);
+    virLogOutputs = NULL;
     virLogNbOutputs = 0;
 }
 
-- 
2.4.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]