summaryrefslogtreecommitdiff
path: root/mimetypes/grammar.y
diff options
context:
space:
mode:
Diffstat (limited to 'mimetypes/grammar.y')
-rw-r--r--mimetypes/grammar.y8
1 files changed, 8 insertions, 0 deletions
diff --git a/mimetypes/grammar.y b/mimetypes/grammar.y
index 2ae1997..2ddc1fd 100644
--- a/mimetypes/grammar.y
+++ b/mimetypes/grammar.y
@@ -55,6 +55,8 @@ arg_list_append (struct arg_list *al, struct mimetypes_string const *str)
{
struct arg_elt *elt;
elt = malloc (sizeof *elt);
+ if (!elt)
+ mimetypes_nomem ();
elt->string.ptr = str->ptr;
elt->string.len = str->len;
LLE_APPEND (al, elt, link);
@@ -126,6 +128,8 @@ rule_line: /* empty */
| TYPE maybe_rule maybe_priority
{
struct rule *p = malloc (sizeof (*p));
+ if (!p)
+ mimetypes_nomem ();
LLE_APPEND (&rule_list, p, link);
p->type = $1.ptr;
p->node = $2;
@@ -271,6 +275,8 @@ static struct node *
make_node (enum node_type type, struct locus_range const *loc)
{
struct node *p = malloc (sizeof *p);
+ if (!p)
+ mimetypes_nomem ();
p->type = type;
locus_range_init (&p->loc);
locus_range_copy (&p->loc, loc);
@@ -339,6 +345,8 @@ make_functional_node (char *ident, struct arg_list *list,
}
args = calloc (count, sizeof *args);
+ if (!args)
+ mimetypes_nomem ();
i = 0;
LL_FOREACH (list, elt, link)
{

Return to:

Send suggestions and report system problems to the System administrator.