提交 b6daacf6 编写于 作者: N Nikolay Shirokovskiy 提交者: Erik Skultety

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: NErik Skultety <eskultet@redhat.com>
上级 56258a38
...@@ -335,11 +335,12 @@ virLogDefineFilter(const char *match, ...@@ -335,11 +335,12 @@ virLogDefineFilter(const char *match,
goto cleanup; goto cleanup;
virLogFiltersSerial++; virLogFiltersSerial++;
ret = virLogNbFilters - 1;
cleanup: cleanup:
virLogUnlock(); virLogUnlock();
if (ret < 0) if (ret < 0)
virReportOOMError(); virReportOOMError();
return virLogNbFilters; return ret;
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册