diff options
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/my_init.c | 4 | ||||
-rw-r--r-- | mysys/my_malloc.c | 2 | ||||
-rw-r--r-- | mysys/safemalloc.c | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/mysys/my_init.c b/mysys/my_init.c index 7db0a58d471..9bd1185a3bf 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -105,6 +105,10 @@ my_bool my_init(void) if (my_thread_global_init()) return 1; +#if defined(SAFEMALLOC) && !defined(DBUG_OFF) + dbug_sanity= sf_sanity; +#endif + /* $HOME is needed early to parse configuration files located in ~/ */ if ((home_dir= getenv("HOME")) != 0) home_dir= intern_filename(home_dir_buff, home_dir); diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c index dc02d3896bd..2b022522f67 100644 --- a/mysys/my_malloc.c +++ b/mysys/my_malloc.c @@ -200,8 +200,6 @@ void *my_realloc(void *oldpoint, size_t size, myf my_flags) /** Free memory allocated with my_malloc. - @remark Relies on free being able to handle a NULL argument. - @param ptr Pointer to the memory allocated by my_malloc. */ void my_free(void *ptr) diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c index b8d9442fbc9..ae8993fbf00 100644 --- a/mysys/safemalloc.c +++ b/mysys/safemalloc.c @@ -330,7 +330,7 @@ static int bad_ptr(const char *where, void *ptr) magicend[3] != MAGICEND3) { DBUG_PRINT("error",("Overrun buffer %p", ptr)); - warn("Error: %s overrun buffer %p", where); + warn("Error: %s overrun buffer %p", where, ptr); fprintf(stderr, "Allocated at "); print_stack(irem->frame); return 1; @@ -340,7 +340,7 @@ static int bad_ptr(const char *where, void *ptr) } /* check all allocated memory list for consistency */ -static int sf_sanity() +int sf_sanity() { struct st_irem *irem; int flag= 0; |