aboutsummaryrefslogtreecommitdiff
path: root/src/meta1gram.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/meta1gram.y')
-rw-r--r--src/meta1gram.y20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/meta1gram.y b/src/meta1gram.y
index 2f774d2..44751f3 100644
--- a/src/meta1gram.y
+++ b/src/meta1gram.y
@@ -49,7 +49,7 @@ struct meta1_stmt
struct meta1_stmt *
meta1_stmt_create (enum meta1_stmt_type type, const char *ident)
{
- struct meta1_stmt *p = xmalloc (sizeof (*p));
+ struct meta1_stmt *p = grecs_malloc (sizeof (*p));
p->next = NULL;
p->type = type;
p->ident = ident;
@@ -152,19 +152,19 @@ ident : META1_IDENT
value : string
{
- $$ = xmalloc (sizeof (*$$));
+ $$ = grecs_malloc (sizeof (*$$));
$$->type = GRECS_TYPE_STRING;
$$->v.string = $1;
}
| list
{
- $$ = xmalloc (sizeof (*$$));
+ $$ = grecs_malloc (sizeof (*$$));
$$->type = GRECS_TYPE_LIST;
$$->v.list = $1;
}
| META1_NUMBER
{
- $$ = xmalloc (sizeof (*$$));
+ $$ = grecs_malloc (sizeof (*$$));
$$->type = GRECS_TYPE_STRING;
$$->v.string = $1;
}
@@ -330,7 +330,7 @@ xlat_listen_socket (struct meta1_stmt *stmt, struct component *comp)
meta1_line_add (p->v.value->v.string, strlen (p->v.value->v.string));
}
}
- val = xmalloc (sizeof (*val));
+ val = grecs_malloc (sizeof (*val));
val->type = GRECS_TYPE_STRING;
val->v.string = meta1_line_finish ();
stmt->type = meta1_simple;
@@ -374,7 +374,8 @@ meta1_translate (struct meta1_stmt *stmt)
{
struct component *comp;
struct meta1_stmt *p;
-
+ size_t len;
+
if (stmt->type != meta1_block)
return;
@@ -386,8 +387,9 @@ meta1_translate (struct meta1_stmt *stmt)
comp->privs.allgroups = 1;
comp->dir = META1_QUEUE_DIR ();
comp->redir[RETR_ERR].type = redir_file;
- comp->redir[RETR_ERR].v.file = xasprintf ("%s/%s.log",
- META1_QUEUE_DIR (),
- comp->tag);
+ comp->redir[RETR_ERR].v.file = NULL;
+ len = 0;
+ grecs_asprintf (&comp->redir[RETR_ERR].v.file, &len,
+ "%s/%s.log", META1_QUEUE_DIR (), comp->tag);
component_finish (comp, &stmt->locus);
}

Return to:

Send suggestions and report system problems to the System administrator.