diff options
author | Dmitry Mikhirev | 2014-11-15 12:05:30 +0300 |
---|---|---|
committer | Dmitry Mikhirev | 2014-11-15 12:05:30 +0300 |
commit | cdc69c4ccbe8fb5d173c1976e71b06aeb756b666 (patch) | |
tree | dc038e931f850228fe695eee3bf49f23388af3c9 | |
parent | e0032af245d18c83dde14d9df3b753d83f054d5a (diff) | |
download | make_pcre-cdc69c4ccbe8fb5d173c1976e71b06aeb756b666.tar.gz make_pcre-cdc69c4ccbe8fb5d173c1976e71b06aeb756b666.tar.bz2 make_pcre-cdc69c4ccbe8fb5d173c1976e71b06aeb756b666.tar.xz make_pcre-cdc69c4ccbe8fb5d173c1976e71b06aeb756b666.zip |
gmk_free strings returned by gmk_expand
-rw-r--r-- | pcre.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -36,7 +36,7 @@ char *match(const char *name, int argc, char **argv) pcre *re; const char *err; int erroffset; - char *str; + char *str = NULL; int ncap = 0; int ovec[MAX_CAP*3]; char *retstr = NULL; @@ -86,6 +86,7 @@ char *match(const char *name, int argc, char **argv) re = pcre_compile(argv[0], 0, &err, &erroffset, NULL); } else { re = pcre_compile(pat, 0, &err, &erroffset, NULL); + gmk_free(pat); } if (re == NULL) { fprintf(stderr, "%s: %d: %s\n", name, erroffset, err); @@ -113,6 +114,9 @@ end_match: *(str + ovec[i*2 + 1]) = c; gmk_eval(mk_set, NULL); } + if (str != NULL) { + gmk_free(str); + } return retstr; } |