From e53dfb24be73a204b4ee8efee6c07e1b13200052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Mon, 6 Feb 2017 10:55:23 +0200 Subject: MDEV-11707: Fix incorrect memset() for structures containing dynamic class GenericPolicy >'; vtable Instead using mem_heap_alloc and memset, use mem_heap_zalloc directly. --- storage/innobase/buf/buf0mtflu.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'storage/innobase/buf') 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(); -- cgit v1.2.1