Logo Search packages:      
Sourcecode: avahi version File versions  Download package

void* avahi_malloc0 ( size_t  size  ) 

Similar to avahi_malloc() but set the memory to zero

Definition at line 113 of file malloc.c.

References AvahiAllocator::calloc, and AvahiAllocator::malloc.

                                 {
    void *p;

    if (size <= 0)
        return NULL;

    if (!allocator)
        return xcalloc(1, size);

    if (allocator->calloc)
        return allocator->calloc(1, size);

    assert(allocator->malloc);
    if ((p = allocator->malloc(size)))
        memset(p, 0, size);

    return p;
}


Generated by  Doxygen 1.6.0   Back to index