summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-01-17 13:41:32 +0200
committerMichael Widenius <monty@askmonty.org>2010-01-17 13:41:32 +0200
commit7b33b9f28764f53a0c39e5207c3db1c47940b6ec (patch)
tree7421c360dc8e749bfb3d03d4f701e3918cfa8eb2 /storage
parent9ca219eee34e6178fe2a5595660d0dfd7787aa23 (diff)
downloadmariadb-git-7b33b9f28764f53a0c39e5207c3db1c47940b6ec.tar.gz
Fixed race condition when innobase_shutdown_for_mysql() was called before parser was initialized (as it's initialized on first usage)
Diffstat (limited to 'storage')
-rw-r--r--storage/xtradb/pars/lexyy.c6
-rw-r--r--storage/xtradb/pars/pars0lex.l6
2 files changed, 8 insertions, 4 deletions
diff --git a/storage/xtradb/pars/lexyy.c b/storage/xtradb/pars/lexyy.c
index 815395ea316..fc6b5102581 100644
--- a/storage/xtradb/pars/lexyy.c
+++ b/storage/xtradb/pars/lexyy.c
@@ -2786,8 +2786,10 @@ void
pars_lexer_close(void)
/*==================*/
{
- yylex_destroy();
- free(stringbuf);
+ if (yy_buffer_stack)
+ yylex_destroy();
+ if (stringbuf)
+ free(stringbuf);
stringbuf = NULL;
stringbuf_len_alloc = stringbuf_len = 0;
}
diff --git a/storage/xtradb/pars/pars0lex.l b/storage/xtradb/pars/pars0lex.l
index 55ed17f82e1..7bd39f7514b 100644
--- a/storage/xtradb/pars/pars0lex.l
+++ b/storage/xtradb/pars/pars0lex.l
@@ -669,8 +669,10 @@ void
pars_lexer_close(void)
/*==================*/
{
- yylex_destroy();
- free(stringbuf);
+ if (yy_buffer_stack)
+ yylex_destroy();
+ if (stringbuf)
+ free(stringbuf);
stringbuf = NULL;
stringbuf_len_alloc = stringbuf_len = 0;
}