summaryrefslogtreecommitdiff
path: root/zero.c
diff options
context:
space:
mode:
Diffstat (limited to 'zero.c')
-rw-r--r--zero.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/zero.c b/zero.c
index bc119ee..5757943 100644
--- a/zero.c
+++ b/zero.c
@@ -18,7 +18,6 @@
* 02110-1301 USA
*/
-#include <error.h>
#include <errno.h>
#include "zero.h"
@@ -93,13 +92,12 @@ build_zero_w_arg(struct expr_node *expr, int own)
struct expr_node *
expr_node_zero(void)
{
- static struct expr_node *node = NULL;
- if (node == NULL) {
- node = malloc(sizeof(*node));
- if (node == NULL)
- error(1, errno, "malloc expr_node_zero");
- expr_init_cb1(node, &zero1_callback,
+ static struct expr_node *nodep = NULL;
+ if (nodep == NULL) {
+ static struct expr_node node;
+ expr_init_cb1(&node, &zero1_callback,
expr_self(), 0, (void *)-1);
+ nodep = &node;
}
- return node;
+ return nodep;
}