From b6daacf6ceb6fbb829522969af9f45a88e5ac3d7 Mon Sep 17 00:00:00 2001 From: Nikolay Shirokovskiy Date: Mon, 12 Sep 2016 13:56:29 +0300 Subject: [PATCH] log: Fix reporting OOM error incorrectly when defining a logging filter When a new filter is being defined, the return code is not handled properly, thus triggering OOM error reporting routine (bug introduced by 51b2606f). Signed-off-by: Erik Skultety --- src/util/virlog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/virlog.c b/src/util/virlog.c index 06f9a602e1..f5b88b68f7 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -335,11 +335,12 @@ virLogDefineFilter(const char *match, goto cleanup; virLogFiltersSerial++; + ret = virLogNbFilters - 1; cleanup: virLogUnlock(); if (ret < 0) virReportOOMError(); - return virLogNbFilters; + return ret; } /** -- GitLab