Skip to content

Commit

Permalink
Bug #29419820: MEMORY LEAK IN MY_YYOVERFLOW()
Browse files Browse the repository at this point in the history
Note: this patch is for 5.6.

Detected by ASAN.

The patch fixes the cleanup of parser stack pointers.

Reviewed-by: Guilhem Bichot <guilhem.bichot@oracle.com>
  • Loading branch information
GlebShchepa authored and vuvova committed Jul 24, 2019
1 parent 8ddb7e3 commit 7473a71
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions sql/sql_lex.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. /* Copyright (c) 2000, 2019, Oracle and/or its affiliates.
Copyright (c) 2010, 2018, MariaDB Corporation Copyright (c) 2010, 2019, MariaDB Corporation
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -2858,15 +2858,18 @@ class Set_signal_information
class Yacc_state class Yacc_state
{ {
public: public:
Yacc_state() Yacc_state() : yacc_yyss(NULL), yacc_yyvs(NULL) { reset(); }
{
reset();
}


void reset() void reset()
{ {
yacc_yyss= NULL; if (yacc_yyss != NULL) {
yacc_yyvs= NULL; my_free(yacc_yyss);
yacc_yyss = NULL;
}
if (yacc_yyvs != NULL) {
my_free(yacc_yyvs);
yacc_yyvs = NULL;
}
m_set_signal_info.clear(); m_set_signal_info.clear();
m_lock_type= TL_READ_DEFAULT; m_lock_type= TL_READ_DEFAULT;
m_mdl_type= MDL_SHARED_READ; m_mdl_type= MDL_SHARED_READ;
Expand Down

0 comments on commit 7473a71

Please sign in to comment.