for (alloclen = 8; alloclen < sizeof(long) + sizeof(*gstr) + len;
alloclen *= 2);
- gstr = malloc(alloclen);
+ gstr = zmalloc(alloclen);
+ if (!gstr) {
+ goto end;
+ }
cds_list_add(&gstr->gc, &parser_ctx->allocated_strings);
gstr->alloclen = alloclen;
+end:
return gstr;
}
struct filter_ast *ast = filter_parser_get_ast(scanner);
struct filter_node *node;
- node = malloc(sizeof(*node));
+ node = zmalloc(sizeof(*node));
if (!node)
return NULL;
memset(node, 0, sizeof(*node));
struct filter_ast *ast = filter_parser_get_ast(scanner);
struct filter_node *node;
- node = malloc(sizeof(*node));
+ node = zmalloc(sizeof(*node));
if (!node)
return NULL;
memset(node, 0, sizeof(*node));
{
struct filter_ast *ast;
- ast = malloc(sizeof(*ast));
+ ast = zmalloc(sizeof(*ast));
if (!ast)
return NULL;
memset(ast, 0, sizeof(*ast));
yydebug = filter_parser_debug;
- parser_ctx = malloc(sizeof(*parser_ctx));
+ parser_ctx = zmalloc(sizeof(*parser_ctx));
if (!parser_ctx)
return NULL;
memset(parser_ctx, 0, sizeof(*parser_ctx));