/* * Duplicate object into a memory pool. * $Id$ * Copyright (c) 1997 by Tycho Softworks. * For conditions of distribution and reuse see product license. */ #include #include void *memdup(void *obj, size_t size) { void *new = (void *)malloc(size); if(!new) return NULL; memcpy(new, obj, size); return new; }