summaryrefslogtreecommitdiff
path: root/sql/sp.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-05-19 04:48:22 +0300
committerunknown <monty@mysql.com>2005-05-19 04:48:22 +0300
commit5082d2d0b4d9997d3f367c5a770016c447a42b75 (patch)
treee451f7cc4aa401af9387732c53ffab0046126c8d /sql/sp.cc
parentdc4a3901746f0d6e51ceb99549a7c2c8bec44161 (diff)
downloadmariadb-git-5082d2d0b4d9997d3f367c5a770016c447a42b75.tar.gz
Fixed references to uninitialized memory
sql/sp.cc: Simpe fix to avoid reference to unallocated memory (only opened was needed, but I reset both to make things safer and simpler)
Diffstat (limited to 'sql/sp.cc')
-rw-r--r--sql/sp.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/sql/sp.cc b/sql/sp.cc
index 81513cb3198..9a816f277ed 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -72,6 +72,9 @@ db_find_routine_aux(THD *thd, int type, sp_name *name,
DBUG_PRINT("enter", ("type: %d name: %*s",
type, name->m_name.length, name->m_name.str));
+ *opened= FALSE;
+ *tablep= 0;
+
/*
Speed up things if mysql.proc doesn't exists. mysql_proc_table_exists
is set when we create or read stored procedure or on flush privileges.
@@ -88,9 +91,7 @@ db_find_routine_aux(THD *thd, int type, sp_name *name,
strcmp(table->s->table_name, "proc") == 0)
break;
}
- if (table)
- *opened= FALSE;
- else
+ if (!table)
{
TABLE_LIST tables;
@@ -99,7 +100,6 @@ db_find_routine_aux(THD *thd, int type, sp_name *name,
tables.table_name= tables.alias= (char*)"proc";
if (! (table= open_ltable(thd, &tables, ltype)))
{
- *tablep= NULL;
/*
Under explicit LOCK TABLES or in prelocked mode we should not
say that mysql.proc table does not exist if we are unable to
@@ -131,7 +131,6 @@ db_find_routine_aux(THD *thd, int type, sp_name *name,
key, table->key_info->key_length,
HA_READ_KEY_EXACT))
{
- *tablep= NULL;
DBUG_RETURN(SP_KEY_NOT_FOUND);
}
*tablep= table;