From 800f555b707c696798877c80352ded46289e87c4 Mon Sep 17 00:00:00 2001 From: MySQL Team Date: Tue, 23 Jan 2001 16:48:50 +0000 Subject: Upgrade ext/mysql/libmysql to version 3.23.32. One notable bug fix is that the client can now connect to a server which is using a default charset other than latin1. --- ext/mysql/libmysql/safemalloc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'ext/mysql/libmysql/safemalloc.c') diff --git a/ext/mysql/libmysql/safemalloc.c b/ext/mysql/libmysql/safemalloc.c index db62b7f3e3..1918034c19 100644 --- a/ext/mysql/libmysql/safemalloc.c +++ b/ext/mysql/libmysql/safemalloc.c @@ -59,6 +59,8 @@ This file is public domain and comes with NO WARRANTY of any kind */ #include "my_static.h" #include "mysys_err.h" +ulonglong safemalloc_mem_limit = ~(ulonglong)0; + #define pNext tInt._pNext #define pPrev tInt._pPrev #define sFileName tInt._sFileName @@ -111,11 +113,15 @@ gptr _mymalloc (uint uSize, const char *sFile, uint uLine, myf MyFlags) DBUG_ENTER("_mymalloc"); DBUG_PRINT("enter",("Size: %u",uSize)); + if (!sf_malloc_quick) (void) _sanity (sFile, uLine); - /* Allocate the physical memory */ - pTmp = (struct remember *) malloc ( + if(uSize + lCurMemory > safemalloc_mem_limit) + pTmp = 0; + else + /* Allocate the physical memory */ + pTmp = (struct remember *) malloc ( sizeof (struct irem) /* remember data */ + sf_malloc_prehunc + uSize /* size requested */ -- cgit v1.2.1