File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -214,7 +214,12 @@ bool CLR_RT_GarbageCollector::TestPointers_PopulateOld_Worker(void **ref)
214
214
215
215
if (dst)
216
216
{
217
- RelocationRecord *ptr = new RelocationRecord ();
217
+ RelocationRecord *ptr = (RelocationRecord *)platform_malloc (sizeof (RelocationRecord));
218
+
219
+ if (!ptr)
220
+ {
221
+ return false ;
222
+ }
218
223
219
224
s_lstRecords.push_back (ptr);
220
225
@@ -233,6 +238,8 @@ bool CLR_RT_GarbageCollector::TestPointers_PopulateOld_Worker(void **ref)
233
238
#else
234
239
CLR_Debug::Printf (" Duplicate base OLD: %08x\r\n " , ref);
235
240
#endif
241
+ // need to free the memory allocated for the record
242
+ platform_free (ptr);
236
243
237
244
NANOCLR_DEBUG_STOP ();
238
245
}
@@ -247,6 +254,9 @@ bool CLR_RT_GarbageCollector::TestPointers_PopulateOld_Worker(void **ref)
247
254
CLR_Debug::Printf (" Some data points into a free list: %08x\r\n " , dst);
248
255
#endif
249
256
257
+ // need to free the memory allocated for the record
258
+ platform_free (ptr);
259
+
250
260
NANOCLR_DEBUG_STOP ();
251
261
}
252
262
}
@@ -263,7 +273,8 @@ void CLR_RT_GarbageCollector::TestPointers_PopulateOld()
263
273
{
264
274
RelocationRecord *ptr = *itLst;
265
275
266
- delete ptr;
276
+ // need to free the memory allocated for the record
277
+ platform_free (ptr);
267
278
}
268
279
269
280
s_lstRecords.clear ();
You can’t perform that action at this time.
0 commit comments