mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-28 13:08:06 +00:00
1479. [bug] cfg_create_tuple() failed to handle out of
memory cleanup. parse_list() would leak memory on syntax errors.
This commit is contained in:
parent
3425cd6803
commit
ad4b2f37e0
4
CHANGES
4
CHANGES
@ -1,3 +1,7 @@
|
|||||||
|
1479. [bug] cfg_create_tuple() failed to handle out of
|
||||||
|
memory cleanup. parse_list() would leak memory
|
||||||
|
on syntax errors.
|
||||||
|
|
||||||
1478. [port] ifconfig.sh didn't account for other virtual
|
1478. [port] ifconfig.sh didn't account for other virtual
|
||||||
interfaces. It now takes a optional arguement
|
interfaces. It now takes a optional arguement
|
||||||
to specify the first interface number. [RT #3907]
|
to specify the first interface number. [RT #3907]
|
||||||
|
@ -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.109 2003/07/03 00:43:28 marka Exp $ */
|
/* $Id: parser.c,v 1.110 2003/07/03 01:50:25 marka Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@ -216,7 +216,8 @@ cfg_create_tuple(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
|
|||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
CLEANUP_OBJ(obj);
|
if (obj != NULL)
|
||||||
|
isc_mem_put(pctx->mctx, obj, sizeof(*obj));
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -973,24 +974,26 @@ parse_list(cfg_parser_t *pctx, const cfg_type_t *listtype, cfg_obj_t **ret)
|
|||||||
cfg_obj_t *listobj = NULL;
|
cfg_obj_t *listobj = NULL;
|
||||||
const cfg_type_t *listof = listtype->of;
|
const cfg_type_t *listof = listtype->of;
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
|
cfg_listelt_t *elt = NULL;
|
||||||
|
|
||||||
CHECK(cfg_create_list(pctx, listtype, &listobj));
|
CHECK(cfg_create_list(pctx, listtype, &listobj));
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
cfg_listelt_t *elt = NULL;
|
|
||||||
|
|
||||||
CHECK(cfg_peektoken(pctx, 0));
|
CHECK(cfg_peektoken(pctx, 0));
|
||||||
if (pctx->token.type == isc_tokentype_special &&
|
if (pctx->token.type == isc_tokentype_special &&
|
||||||
pctx->token.value.as_char == '}')
|
pctx->token.value.as_char == /*{*/ '}')
|
||||||
break;
|
break;
|
||||||
CHECK(cfg_parse_listelt(pctx, listof, &elt));
|
CHECK(cfg_parse_listelt(pctx, listof, &elt));
|
||||||
CHECK(parse_semicolon(pctx));
|
CHECK(parse_semicolon(pctx));
|
||||||
ISC_LIST_APPEND(listobj->value.list, elt, link);
|
ISC_LIST_APPEND(listobj->value.list, elt, link);
|
||||||
|
elt = NULL;
|
||||||
}
|
}
|
||||||
*ret = listobj;
|
*ret = listobj;
|
||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
if (elt != NULL)
|
||||||
|
free_list_elt(pctx, elt);
|
||||||
CLEANUP_OBJ(listobj);
|
CLEANUP_OBJ(listobj);
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
@ -1303,7 +1306,6 @@ parse_symtab_elt(cfg_parser_t *pctx, const char *name,
|
|||||||
CHECK(isc_symtab_define(symtab, name,
|
CHECK(isc_symtab_define(symtab, name,
|
||||||
1, symval,
|
1, symval,
|
||||||
isc_symexists_reject));
|
isc_symexists_reject));
|
||||||
obj = NULL;
|
|
||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user