diff options
author | Alexander Barkov <bar@mariadb.org> | 2018-01-29 12:44:20 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2018-01-29 12:44:20 +0400 |
commit | c7a2f23a7b751cd54dbdcff46a3e7bc1eabe4c02 (patch) | |
tree | 5f884e1fdf15a1a7d3738b1dff17a91d2c26623f /mysys | |
parent | b4a2baffa82e5c07b96a1c752228560dcac1359b (diff) | |
parent | b12430adc716be51810953920448563c87fe0521 (diff) | |
download | mariadb-git-c7a2f23a7b751cd54dbdcff46a3e7bc1eabe4c02.tar.gz |
Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/file_logger.c | 4 | ||||
-rw-r--r-- | mysys/my_malloc.c | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/mysys/file_logger.c b/mysys/file_logger.c index 078286cd7d0..35a077c4391 100644 --- a/mysys/file_logger.c +++ b/mysys/file_logger.c @@ -172,7 +172,7 @@ int logger_vprintf(LOGGER_HANDLE *log, const char* fmt, va_list ap) if (n_bytes >= sizeof(cvtbuf)) n_bytes= sizeof(cvtbuf) - 1; - result= my_write(log->file, (uchar *) cvtbuf, n_bytes, MYF(0)); + result= (int)my_write(log->file, (uchar *) cvtbuf, n_bytes, MYF(0)); exit: flogger_mutex_unlock(&log->lock); @@ -196,7 +196,7 @@ int logger_write(LOGGER_HANDLE *log, const char *buffer, size_t size) goto exit; /* Log rotation needed but failed */ } - result= my_write(log->file, (uchar *) buffer, size, MYF(0)); + result= (int)my_write(log->file, (uchar *) buffer, size, MYF(0)); exit: flogger_mutex_unlock(&log->lock); diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c index 6b24f777aaa..6a3ec8da093 100644 --- a/mysys/my_malloc.c +++ b/mysys/my_malloc.c @@ -212,6 +212,13 @@ void my_free(void *ptr) my_bool old_flags; old_size= MALLOC_SIZE_AND_FLAG(ptr, &old_flags); update_malloc_size(- (longlong) old_size - MALLOC_PREFIX_SIZE, old_flags); +#ifndef SAFEMALLOC + /* + Trash memory if not safemalloc. We don't have to do this if safemalloc + is used as safemalloc will also do trashing + */ + TRASH_FREE(ptr, old_size); +#endif sf_free(MALLOC_FIX_POINTER_FOR_FREE(ptr)); } DBUG_VOID_RETURN; |