Applied patch from Bug #14970 to fix memory allocation errors in tests on some machines