- *mem_malloc= self->allocators.malloc;
- *mem_free= self->allocators.free;
- *mem_realloc= self->allocators.realloc;
- *mem_calloc= self->allocators.calloc;
+ if (self == NULL)
+ {
+ return;
+ }
+
+ if (mem_malloc)
+ {
+ *mem_malloc= self->allocators.malloc;
+ }
+
+ if (mem_free)
+ {
+ *mem_free= self->allocators.free;
+ }
+
+ if (mem_realloc)
+ {
+ *mem_realloc= self->allocators.realloc;
+ }
+
+ if (mem_calloc)
+ {
+ *mem_calloc= self->allocators.calloc;
+ }