diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index 6e32242699..7c76e6ba5e 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -659,7 +659,12 @@ openvzReadConfigParam(const char *conf_file, const char *param, char **value) return -1; VIR_FREE(*value); - while (getline(&line, &line_size, fp) >= 0) { + while (1) { + if (getline(&line, &line_size, fp) < 0) { + err = !feof(fp); + break; + } + if (! STREQLEN(line, param, strlen(param))) continue;