mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 03:47:17 +02:00
Backport "NULL pointer check for ut_free()" from mysql-trunk-innodb to
mysql-5.1-innodb plugin to fix bug #55627 segv in ut_free pars_lexer_close innobase_shutdown innodb-use-sys-malloc=0.
This commit is contained in:
parent
190ec75c35
commit
666dfaf090
3 changed files with 13 additions and 4 deletions
|
|
@ -290,7 +290,8 @@ ut_test_malloc(
|
|||
#endif /* !UNIV_HOTBACKUP */
|
||||
|
||||
/**********************************************************************//**
|
||||
Frees a memory block allocated with ut_malloc. */
|
||||
Frees a memory block allocated with ut_malloc. Freeing a NULL pointer is
|
||||
a nop. */
|
||||
UNIV_INTERN
|
||||
void
|
||||
ut_free(
|
||||
|
|
@ -300,7 +301,9 @@ ut_free(
|
|||
#ifndef UNIV_HOTBACKUP
|
||||
ut_mem_block_t* block;
|
||||
|
||||
if (UNIV_LIKELY(srv_use_sys_malloc)) {
|
||||
if (ptr == NULL) {
|
||||
return;
|
||||
} else if (UNIV_LIKELY(srv_use_sys_malloc)) {
|
||||
free(ptr);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue