Bug 956630. Replace nsMemory::Alloc/nsMemory::Realloc calls with moz_malloc/moz_realloc to avoid application aborts and successfully check for not allocated memory. r=jduell