(errcode_for_file_access(),
errmsg("could not open configuration file \"%s\": %m",
abs_path)));
- return false;
+ OK = false;
+ goto cleanup;
}
ereport(LOG,
(errmsg("skipping missing configuration file \"%s\"",
abs_path)));
- return OK;
+ OK = true;
+ goto cleanup;
}
OK = ParseConfigFp(fp, abs_path, depth, elevel, head_p, tail_p);
- FreeFile(fp);
+cleanup:
+ if (fp)
+ FreeFile(fp);
pfree(abs_path);
return OK;
(errcode_for_file_access(),
errmsg("could not open configuration directory \"%s\": %m",
directory)));
- return false;
+ status = false;
+ goto cleanup;
}
/*
(errcode_for_file_access(),
errmsg("could not stat file \"%s\": %m",
filename)));
- return false;
+ status = false;
+ goto cleanup;
}
}
status = true;
cleanup:
- FreeDir(d);
+ if (d)
+ FreeDir(d);
+ pfree(directory);
return status;
}