diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2014-03-30 21:05:35 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2014-05-03 00:34:21 +0400 |
commit | b9cb8bd02d344fe82216bbae95232395681d8ac8 (patch) | |
tree | bcb53000aeaf4c5db894550c0f8ce3b8531a6d7a | |
parent | fc12c339246d10dd42a8e8650223e38aadf2c988 (diff) | |
download | bdwgc-b9cb8bd02d344fe82216bbae95232395681d8ac8.tar.gz |
Fix GC_scratch_last_end_ptr update on GC_scratch_alloc failure
* headers.c (GC_scratch_alloc): Do not update GC_scratch_last_end_ptr
if allocation failed ("result" variable is NULL).
-rw-r--r-- | headers.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -134,7 +134,9 @@ GC_INNER ptr_t GC_scratch_alloc(size_t bytes) result = (ptr_t)GET_MEM(bytes_to_get); GC_add_to_our_memory(result, bytes_to_get); scratch_free_ptr -= bytes; - GC_scratch_last_end_ptr = result + bytes; + if (result != NULL) { + GC_scratch_last_end_ptr = result + bytes; + } return(result); } |