aboutsummaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2019-01-25 11:55:54 +0200
committerArnold D. Robbins <arnold@skeeve.com>2019-01-25 11:55:54 +0200
commiteea77e4b393b7c1841da887f590b5f5eab964ad4 (patch)
treeeb0e955851fbdd85250e12fbfaa5ec390d1088f9 /profile.c
parent48f4822b0602c44aacd418f36ff35645e8379b8e (diff)
parentfda51ca6fd0d9ad93bead9887ded0b07c90680fb (diff)
downloadegawk-eea77e4b393b7c1841da887f590b5f5eab964ad4.tar.gz
egawk-eea77e4b393b7c1841da887f590b5f5eab964ad4.tar.bz2
egawk-eea77e4b393b7c1841da887f590b5f5eab964ad4.zip
Merge branch 'feature/fix-ns-memleak'
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/profile.c b/profile.c
index 3d954d30..1a1a1e96 100644
--- a/profile.c
+++ b/profile.c
@@ -2033,6 +2033,8 @@ pp_namespace(const char *name, INSTRUCTION *comment)
if (strcmp(current_namespace, name) == 0)
return;
+ // don't need to free current_namespace, it comes from
+ // info saved in Op_namespace instructions.
current_namespace = name;
if (do_profile)
@@ -2070,7 +2072,8 @@ adjust_namespace(char *name, bool *malloced)
// unadorned name from symbol table, add awk:: if not in awk:: n.s.
if (strchr(name, ':') == NULL &&
current_namespace != awk_namespace && // can be equal if namespace never changed
- strcmp(current_namespace, "awk") != 0) {
+ strcmp(current_namespace, "awk") != 0 &&
+ ! is_all_upper(name)) {
char *buf;
size_t len = 5 + strlen(name) + 1;