diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-07-03 11:54:01 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-07-03 11:54:01 +0200 |
commit | 2211fa70ccad29fc7bccd34c13141850ebb199da (patch) | |
tree | 2648e3d59b6da60b41e7adc38b85b4a090ae9abc | |
parent | e1e7ad6b6005b2265667040fc9d7f69b73b0d5b0 (diff) | |
download | busybox-w32-2211fa70ccad29fc7bccd34c13141850ebb199da.tar.gz busybox-w32-2211fa70ccad29fc7bccd34c13141850ebb199da.tar.bz2 busybox-w32-2211fa70ccad29fc7bccd34c13141850ebb199da.zip |
awk: do not use a copy of g_progname for node->l.new_progname
We never destroy g_progname's, the strings still exist, no need to copy
function old new delta
chain_node 104 97 -7
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | editors/awk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/editors/awk.c b/editors/awk.c index 2c3b49bc8..4119253ec 100644 --- a/editors/awk.c +++ b/editors/awk.c | |||
@@ -179,7 +179,7 @@ typedef struct node_s { | |||
179 | struct node_s *n; | 179 | struct node_s *n; |
180 | var *v; | 180 | var *v; |
181 | int aidx; | 181 | int aidx; |
182 | char *new_progname; | 182 | const char *new_progname; |
183 | regex_t *re; | 183 | regex_t *re; |
184 | } l; | 184 | } l; |
185 | union { | 185 | union { |
@@ -1501,7 +1501,7 @@ static node *chain_node(uint32_t info) | |||
1501 | if (seq->programname != g_progname) { | 1501 | if (seq->programname != g_progname) { |
1502 | seq->programname = g_progname; | 1502 | seq->programname = g_progname; |
1503 | n = chain_node(OC_NEWSOURCE); | 1503 | n = chain_node(OC_NEWSOURCE); |
1504 | n->l.new_progname = xstrdup(g_progname); | 1504 | n->l.new_progname = g_progname; |
1505 | } | 1505 | } |
1506 | 1506 | ||
1507 | n = seq->last; | 1507 | n = seq->last; |