]> git.droids-corp.org - protos/libecoli.git/blobdiff - lib/ecoli_malloc.c
log
[protos/libecoli.git] / lib / ecoli_malloc.c
index 0768cab783f223ef0f1250e7cb9ae33acbcc7c8d..7c6f48901f19bd130badcb310dbd91989e3dab77 100644 (file)
@@ -49,6 +49,7 @@ int ec_malloc_register(ec_malloc_t usr_malloc, ec_free_t usr_free,
 
 void ec_malloc_unregister(void)
 {
+       /* XXX handlers must set errno on error */
        ec_malloc_handler.malloc = NULL;
        ec_malloc_handler.free = NULL;
        ec_malloc_handler.realloc = NULL;
@@ -80,6 +81,7 @@ void *__ec_calloc(size_t nmemb, size_t size, const char *file,
        void *ptr;
        size_t total;
 
+       /* check overflow */
        total = size * nmemb;
        if (nmemb != 0 && size != (total / nmemb)) {
                errno = ENOMEM;