diff options
author | Chanho Park <chanho61.park@samsung.com> | 2014-08-22 20:34:56 +0900 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-08-22 20:34:56 +0900 |
commit | 517f5529d7008eba87b8b2fee5ec9ec0a5075f6e (patch) | |
tree | c71720a9b41309713c089478f921165bd2d63b25 /zero.c | |
parent | 689b9dbb8d7f88ab91e7741932ed000b6e49be9a (diff) | |
download | ltrace-517f5529d7008eba87b8b2fee5ec9ec0a5075f6e.tar.gz ltrace-517f5529d7008eba87b8b2fee5ec9ec0a5075f6e.tar.bz2 ltrace-517f5529d7008eba87b8b2fee5ec9ec0a5075f6e.zip |
Imported Upstream version 0.7.91upstream/0.7.91upstream
Diffstat (limited to 'zero.c')
-rw-r--r-- | zero.c | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -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; } |