diff options
author | Alexey Botchkov <holyfoot@mysql.com> | 2008-11-21 17:38:42 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@mysql.com> | 2008-11-21 17:38:42 +0400 |
commit | d445b215d10d1239d097d9fb362f232ec9bdb2f4 (patch) | |
tree | 0ee040b7dd3afd19bf08093c172f7445efa8e238 /sql/sp_pcontext.cc | |
parent | 1cd8b9f700a3d20e0af43896b366cef6ef0e7d4c (diff) | |
download | mariadb-git-d445b215d10d1239d097d9fb362f232ec9bdb2f4.tar.gz |
Bug#25058 ignored return codes in memory allocation functions
memory allocation error checks added for functions
calling insert_dynamic()
per-file messages:
myisam/mi_delete.c
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
myisam/mi_write.c
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
server-tools/instance-manager/instance_options.cc
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
sql/slave.cc
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
sql/sp_head.cc
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
sql/sp_head.h
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
sql/sp_pcontext.cc
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
sql/sp_pcontext.h
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
sql/sql_select.cc
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
sql/sql_yacc.yy
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
Diffstat (limited to 'sql/sp_pcontext.cc')
-rw-r--r-- | sql/sp_pcontext.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc index 780243cc79f..265964d3d45 100644 --- a/sql/sp_pcontext.cc +++ b/sql/sp_pcontext.cc @@ -263,7 +263,8 @@ sp_pcontext::push_variable(LEX_STRING *name, enum enum_field_types type, p->mode= mode; p->offset= current_var_count(); p->dflt= NULL; - insert_dynamic(&m_vars, (gptr)&p); + if (insert_dynamic(&m_vars, (gptr)&p)) + return NULL; return p; } @@ -308,18 +309,17 @@ sp_pcontext::find_label(char *name) return NULL; } -void +int sp_pcontext::push_cond(LEX_STRING *name, sp_cond_type_t *val) { sp_cond_t *p= (sp_cond_t *)sql_alloc(sizeof(sp_cond_t)); - if (p) - { - p->name.str= name->str; - p->name.length= name->length; - p->val= val; - insert_dynamic(&m_conds, (gptr)&p); - } + if (p == NULL) + return 1; + p->name.str= name->str; + p->name.length= name->length; + p->val= val; + return insert_dynamic(&m_conds, (gptr)&p); } /* @@ -382,7 +382,7 @@ sp_pcontext::find_handler(sp_cond_type_t *cond) return FALSE; } -void +int sp_pcontext::push_cursor(LEX_STRING *name) { LEX_STRING n; @@ -391,7 +391,7 @@ sp_pcontext::push_cursor(LEX_STRING *name) m_max_cursor_index+= 1; n.str= name->str; n.length= name->length; - insert_dynamic(&m_cursors, (gptr)&n); + return insert_dynamic(&m_cursors, (gptr)&n); } /* |