--- libaitio/src/Attic/mem.c 2012/05/23 13:53:00 1.1.4.4 +++ libaitio/src/Attic/mem.c 2012/07/03 08:51:05 1.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: mem.c,v 1.1.4.4 2012/05/23 13:53:00 misho Exp $ +* $Id: mem.c,v 1.2 2012/07/03 08:51:05 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -402,11 +402,13 @@ mpool_free(mpool_t * __restrict mp, void * __restrict int idx; struct tagAlloc *m, *tmp; + assert(data); if (!mp) { io_SetErr(EINVAL, "Pool not specified"); return -1; } /* check address range & sentinel */ + assert(!MEM_BADADDR(data) && !MEM_CORRUPT(data)); if (MEM_BADADDR(data) || MEM_CORRUPT(data)) { io_SetErr(EFAULT, "Corrupted memory address"); return -2;