using the pointer 'b->block' when it is possible that reallocation has moved the memory to another location. 'b->block' may therefore be an invalid pointer in some cases. use 'ret' intead.