From: Amitay Isaacs Date: Wed, 4 Jul 2018 07:45:45 +0000 (+1000) Subject: ctdb-common: Fix CID 437606 X-Git-Tag: tevent-0.9.37~87 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b2d75c0108f6edc7234bfa23a82b2c6c228a836f;p=thirdparty%2Fsamba.git ctdb-common: Fix CID 437606 Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- diff --git a/ctdb/common/conf.c b/ctdb/common/conf.c index 3c1369e138d..74af7f8a048 100644 --- a/ctdb/common/conf.c +++ b/ctdb/common/conf.c @@ -1014,11 +1014,6 @@ static int conf_load_internal(struct conf_context *conf) int ret; bool ok; - fp = fopen(conf->filename, "r"); - if (fp == NULL) { - return errno; - } - state = (struct conf_load_state) { .conf = conf, .mode = (conf->reload ? CONF_MODE_RELOAD : CONF_MODE_LOAD), @@ -1029,6 +1024,11 @@ static int conf_load_internal(struct conf_context *conf) return ret; } + fp = fopen(conf->filename, "r"); + if (fp == NULL) { + return errno; + } + ok = tini_parse(fp, false, conf_load_section,