memory/file checker for alloc and open