mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Add my_str_malloc and _free function pointers to strings library
which will by default exit(1) if malloc() fails, but can be set to do something else by the calling program does, which mysqld does to use my_malloc(..., MYF(MY_FAE)) instead. Also checks allocation in conf_to_src utility program. (Bug #7003)
This commit is contained in:
@ -75,6 +75,8 @@ static int get_charset_number(const char *charset_name)
|
||||
char *mdup(const char *src, uint len)
|
||||
{
|
||||
char *dst=(char*)malloc(len);
|
||||
if (!dst)
|
||||
exit(1);
|
||||
memcpy(dst,src,len);
|
||||
return dst;
|
||||
}
|
||||
|
Reference in New Issue
Block a user