summaryrefslogtreecommitdiff
path: root/storage/innobase/buf
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2017-02-06 10:55:23 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2017-02-06 15:40:17 +0200
commite53dfb24be73a204b4ee8efee6c07e1b13200052 (patch)
treec0b724ad3f917f2f13d02c4ca3641ab50fd60515 /storage/innobase/buf
parentddf2fac73381b84114d31c178d9207afc27bfa4d (diff)
downloadmariadb-git-e53dfb24be73a204b4ee8efee6c07e1b13200052.tar.gz
MDEV-11707: Fix incorrect memset() for structures containing
dynamic class GenericPolicy<TTASEventMutex<GenericPolicy> >'; vtable Instead using mem_heap_alloc and memset, use mem_heap_zalloc directly.
Diffstat (limited to 'storage/innobase/buf')
-rw-r--r--storage/innobase/buf/buf0mtflu.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/storage/innobase/buf/buf0mtflu.cc b/storage/innobase/buf/buf0mtflu.cc
index e990ba785e7..ac8a8f8f491 100644
--- a/storage/innobase/buf/buf0mtflu.cc
+++ b/storage/innobase/buf/buf0mtflu.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (C) 2013, 2014, Fusion-io. All Rights Reserved.
-Copyright (C) 2013, 2015, MariaDB Corporation. All Rights Reserved.
+Copyright (C) 2013, 2017, MariaDB Corporation. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -486,14 +486,13 @@ buf_mtflu_handler_init(
mtflush_heap2 = mem_heap_create(0);
ut_a(mtflush_heap2 != NULL);
- mtflush_ctx = (thread_sync_t *)mem_heap_alloc(mtflush_heap,
+ mtflush_ctx = (thread_sync_t *)mem_heap_zalloc(mtflush_heap,
sizeof(thread_sync_t));
- memset(mtflush_ctx, 0, sizeof(thread_sync_t));
+
ut_a(mtflush_ctx != NULL);
- mtflush_ctx->thread_data = (thread_data_t*)mem_heap_alloc(
+ mtflush_ctx->thread_data = (thread_data_t*)mem_heap_zalloc(
mtflush_heap, sizeof(thread_data_t) * n_threads);
ut_a(mtflush_ctx->thread_data);
- memset(mtflush_ctx->thread_data, 0, sizeof(thread_data_t) * n_threads);
mtflush_ctx->n_threads = n_threads;
mtflush_ctx->wq = ib_wqueue_create();