projects
/
project
/
jsonpath.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c95f8d8
)
parser: fix error reporting
author
Jo-Philipp Wich
<jow@openwrt.org>
Wed, 1 Jan 2014 21:39:23 +0000
(21:39 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Wed, 1 Jan 2014 21:53:09 +0000
(21:53 +0000)
parser.y
patch
|
blob
|
history
diff --git
a/parser.y
b/parser.y
index e3b9ee989e489ff6c61674cfd77d5ae153448f5f..54c60779bda346f22f6540869e9551030d376b0e 100644
(file)
--- a/
parser.y
+++ b/
parser.y
@@
-58,7
+58,7
@@
struct jp_opcode {
struct jp_state {
struct jp_opcode *pool;
struct jp_opcode *path;
- c
onst c
har *error;
+ char *error;
char str_quote;
char str_buf[128];
char *str_ptr;
@@
-167,7
+167,7
@@
unary_exp
void
yyerror(struct jp_state *s, const char *msg)
{
- s->error =
msg
;
+ s->error =
strdup(msg)
;
}
static struct jp_opcode *
@@
-253,5
+253,8
@@
jp_free(struct jp_state *s)
op = tmp;
}
+ if (s->error)
+ free(s->error);
+
free(s);
}