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

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



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.11


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