Skip to content

Commit 16bc16f

Browse files
committed
Actually invoke free() in ut_allocator::deallocate().
The necessary call was inadvertently commented out in a merge of MySQL 5.7.14 to MariaDB 10.2.1 (commit fec844a).
1 parent a5d8dc1 commit 16bc16f

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

storage/innobase/include/ut0new.h

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 2014, 2015, Oracle and/or its affiliates. All Rights Reserved.
4+
Copyright (c) 2017, MariaDB Corporation.
45
56
This program is free software; you can redistribute it and/or modify it under
67
the terms of the GNU General Public License as published by the Free Software
@@ -389,25 +390,21 @@ class ut_allocator {
389390
}
390391

391392
/** Free a memory allocated by allocate() and trace the deallocation.
392-
@param[in,out] ptr pointer to memory to free
393-
@param[in] n_elements number of elements allocated (unused) */
394-
void
395-
deallocate(
396-
pointer ptr,
397-
size_type n_elements = 0)
393+
@param[in,out] ptr pointer to memory to free */
394+
void deallocate(pointer ptr, size_type)
398395
{
396+
#ifdef UNIV_PFS_MEMORY
399397
if (ptr == NULL) {
400398
return;
401399
}
402400

403-
#ifdef UNIV_PFS_MEMORY
404401
ut_new_pfx_t* pfx = reinterpret_cast<ut_new_pfx_t*>(ptr) - 1;
405402

406403
deallocate_trace(pfx);
407404

408405
free(pfx);
409406
#else
410-
// free(ptr);
407+
free(ptr);
411408
#endif /* UNIV_PFS_MEMORY */
412409
}
413410

0 commit comments

Comments
 (0)