mdbx: backport - fix nasty suspend_and_append() bug.

Change-Id: I043adcff2e6c040426a51b5d4b15bac849e6dd9f
This commit is contained in:
Leo Yuriev 2018-07-24 00:17:54 +03:00
parent d1809e6e2d
commit e57e521609

View File

@ -190,7 +190,9 @@ static int suspend_and_append(mdbx_handle_array_t **array,
(limit * 2 - ARRAY_LENGTH((*array)->handles)));
if (!ptr)
return MDBX_ENOMEM;
(*array) = (mdbx_handle_array_t *)ptr;
if (limit == ARRAY_LENGTH((*array)->handles))
memcpy(ptr, *array, sizeof(mdbx_handle_array_t));
*array = (mdbx_handle_array_t *)ptr;
(*array)->limit = limit * 2;
}