2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 15:05:23 +00:00

840. [bug] The config file parser could print the wrong file

name if an error was detected after an included file
			was parsed. [RT #1353]
This commit is contained in:
Brian Wellington
2001-05-28 06:05:24 +00:00
parent 89d03d4715
commit cf74d05a50
2 changed files with 18 additions and 3 deletions

View File

@@ -1,3 +1,7 @@
840. [bug] The config file parser could print the wrong file
name if an error was detected after an included file
was parsed. [RT #1353]
839. [func] Dump packets for which there was no view or that the 839. [func] Dump packets for which there was no view or that the
class could not be determined to category "unmatched". class could not be determined to category "unmatched".

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: parser.c,v 1.52 2001/05/09 03:17:02 gson Exp $ */ /* $Id: parser.c,v 1.53 2001/05/28 06:05:24 bwelling Exp $ */
#include <config.h> #include <config.h>
@@ -2010,6 +2010,12 @@ create_listelt(cfg_parser_t *pctx, cfg_listelt_t **eltp) {
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }
static void
free_list_elt(cfg_parser_t *pctx, cfg_listelt_t *elt) {
cfg_obj_destroy(pctx, &elt->obj);
isc_mem_put(pctx->mctx, elt, sizeof(*elt));
}
static void static void
free_list(cfg_parser_t *pctx, cfg_obj_t *obj) { free_list(cfg_parser_t *pctx, cfg_obj_t *obj) {
cfg_listelt_t *elt, *next; cfg_listelt_t *elt, *next;
@@ -2018,8 +2024,7 @@ free_list(cfg_parser_t *pctx, cfg_obj_t *obj) {
elt = next) elt = next)
{ {
next = ISC_LIST_NEXT(elt, link); next = ISC_LIST_NEXT(elt, link);
cfg_obj_destroy(pctx, &elt->obj); free_list_elt(pctx, elt);
isc_mem_put(pctx->mctx, elt, sizeof(*elt));
} }
} }
@@ -3459,6 +3464,12 @@ cfg_gettoken(cfg_parser_t *pctx, int options) {
/* /*
* Closed an included file, not the main file. * Closed an included file, not the main file.
*/ */
cfg_listelt_t *elt;
elt = ISC_LIST_TAIL(pctx->files->value.list);
INSIST(elt != NULL);
ISC_LIST_UNLINK(pctx->files->value.list,
elt, link);
free_list_elt(pctx, elt);
goto redo; goto redo;
} }
pctx->seen_eof = ISC_TRUE; pctx->seen_eof = ISC_TRUE;