diff --git a/toml.c b/toml.c index f0a80bc..b41b647 100644 --- a/toml.c +++ b/toml.c @@ -46,10 +46,10 @@ void toml_set_memutil(void* (*xxmalloc)(size_t), void* (*xxcalloc)(size_t, size_t), void* (*xxrealloc)(void*, size_t)) { - ppmalloc = xxmalloc; - ppfree = xxfree; - ppcalloc = xxcalloc; - pprealloc = xxrealloc; + if (xxmalloc) ppmalloc = xxmalloc; + if (xxfree) ppfree = xxfree; + if (xxcalloc) ppcalloc = xxcalloc; + if (xxrealloc) pprealloc = xxrealloc; }