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 <eskultet@redhat.com>
This commit is contained in:
Nikolay Shirokovskiy 2016-09-12 13:56:29 +03:00 committed by Erik Skultety
parent 56258a388f
commit b6daacf6ce

View File

@ -335,11 +335,12 @@ virLogDefineFilter(const char *match,
goto cleanup;
virLogFiltersSerial++;
ret = virLogNbFilters - 1;
cleanup:
virLogUnlock();
if (ret < 0)
virReportOOMError();
return virLogNbFilters;
return ret;
}
/**