mdbx: 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 dfea68270a
commit 21858201e0

View File

@ -199,7 +199,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;
}