projects
/
paraslash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
62c0894
)
mp: Always set mp_context to NULL on errors.
author
Andre Noll
<maan@tuebingen.mpg.de>
Mon, 16 Mar 2020 17:44:07 +0000
(18:44 +0100)
committer
Andre Noll
<maan@tuebingen.mpg.de>
Thu, 17 Sep 2020 15:43:02 +0000
(17:43 +0200)
In mp_init(), if mp_yyparse() fails, we return early without setting
the result pointer to NULL. This does not matter much because both
callers of mood.c pass in NULL, but still..
mp.c
patch
|
blob
|
history
diff --git
a/mp.c
b/mp.c
index
bade05b
..
56c16e3
100644
(file)
--- a/
mp.c
+++ b/
mp.c
@@
-491,10
+491,10
@@
int mp_init(const char *definition, int nbytes, struct mp_context **result,
struct mp_context *ctx;
struct yy_buffer_state *buffer_state;
+ *result = NULL;
if (!definition || nbytes == 0) { /* dummy mood */
if (errmsg)
*errmsg = NULL;
- *result = NULL;
return 0;
}
ctx = para_calloc(sizeof(*ctx));