Commit e53dfb24 authored by Jan Lindström's avatar Jan Lindström

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.
parent ddf2fac7
/***************************************************************************** /*****************************************************************************
Copyright (C) 2013, 2014, Fusion-io. All Rights Reserved. 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 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 the terms of the GNU General Public License as published by the Free Software
...@@ -486,14 +486,13 @@ buf_mtflu_handler_init( ...@@ -486,14 +486,13 @@ buf_mtflu_handler_init(
mtflush_heap2 = mem_heap_create(0); mtflush_heap2 = mem_heap_create(0);
ut_a(mtflush_heap2 != NULL); 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)); sizeof(thread_sync_t));
memset(mtflush_ctx, 0, sizeof(thread_sync_t));
ut_a(mtflush_ctx != NULL); 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); mtflush_heap, sizeof(thread_data_t) * n_threads);
ut_a(mtflush_ctx->thread_data); 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->n_threads = n_threads;
mtflush_ctx->wq = ib_wqueue_create(); mtflush_ctx->wq = ib_wqueue_create();
......
/***************************************************************************** /*****************************************************************************
Copyright (C) 2013, 2014, Fusion-io. All Rights Reserved. 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 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 the terms of the GNU General Public License as published by the Free Software
...@@ -486,14 +486,13 @@ buf_mtflu_handler_init( ...@@ -486,14 +486,13 @@ buf_mtflu_handler_init(
mtflush_heap2 = mem_heap_create(0); mtflush_heap2 = mem_heap_create(0);
ut_a(mtflush_heap2 != NULL); 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)); sizeof(thread_sync_t));
memset(mtflush_ctx, 0, sizeof(thread_sync_t));
ut_a(mtflush_ctx != NULL); 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); mtflush_heap, sizeof(thread_data_t) * n_threads);
ut_a(mtflush_ctx->thread_data); 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->n_threads = n_threads;
mtflush_ctx->wq = ib_wqueue_create(); mtflush_ctx->wq = ib_wqueue_create();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment