mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-18 19:50:54 +00:00
BUG/MINOR: cache: Wrong usage of shctx_init().
With this patch we check that shctx_init() does not returns 0. This is possible if the maxblocks argument, which is passed as an int, is negative due to an implicit conversion. Must be backported to 1.8.
This commit is contained in:
parent
b9b8b6b6be
commit
bc584494e6
@ -925,7 +925,7 @@ int cfg_post_parse_section_cache()
|
||||
ret_shctx = shctx_init(&shctx, tmp_cache_config->maxblocks, CACHE_BLOCKSIZE,
|
||||
tmp_cache_config->maxobjsz, sizeof(struct cache), 1);
|
||||
|
||||
if (ret_shctx < 0) {
|
||||
if (ret_shctx <= 0) {
|
||||
if (ret_shctx == SHCTX_E_INIT_LOCK)
|
||||
ha_alert("Unable to initialize the lock for the cache.\n");
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user