Branch: Tag:

2014-04-15

2014-04-15 17:46:11 by Arne Goedeke <el@laramies.com>

block_allocator: always check ptr validity on free

301:    }   found:    - #ifdef PIKE_DEBUG +     if (p) { - #endif -  { +     struct ba_block_header * b = (struct ba_block_header*)ptr;   #ifdef PIKE_DEBUG    if (!p->h.used) {
323:    ba_clear_page(a, p, &l);    }    } -  } - #ifdef PIKE_DEBUG +     } else { -  + #ifdef PIKE_DEBUG    print_allocator(a); -  + #endif    Pike_fatal("ptr %p not in any page.\n", ptr);    } - #endif +     PIKE_MEMPOOL_FREE(a, ptr, a->l.block_size);   }