BUG/MINOR: tune.fail-alloc: Don't forget to initialize ret.

In mem_should_fail(), if we don't want to fail the allocation, either
because mem_fail_rate is 0, or because we're still initializing, don't
forget to initialize ret, or we may return a non-zero value, and fail
an allocation we didn't want to fail.
This should only affect users that compile with DEBUG_FAIL_ALLOC.
This commit is contained in:
Olivier Houchard 2019-02-01 16:28:04 +01:00 committed by Olivier Houchard
parent 3e451842dc
commit 9c4f08ae39

View File

@ -581,7 +581,7 @@ __decl_hathreads(static HA_SPINLOCK_T mem_fail_lock);
int mem_should_fail(const struct pool_head *pool)
{
int ret;
int ret = 0;
int n;
if (mem_fail_rate > 0 && !(global.mode & MODE_STARTING)) {