--- libaitsched/src/tasks.c 2012/08/02 13:45:02 1.10.2.11 +++ libaitsched/src/tasks.c 2012/08/02 13:53:22 1.10.2.12 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: tasks.c,v 1.10.2.11 2012/08/02 13:45:02 misho Exp $ +* $Id: tasks.c,v 1.10.2.12 2012/08/02 13:53:22 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -745,7 +745,7 @@ schedLIORead(sched_root_task_t * __restrict root, sche for (i = 0; i < nbufs; i++) if (acb[i]) free(acb[i]); - free(acb); + free(acb); return NULL; } else memset(acb[i], 0, sizeof(struct aiocb)); @@ -762,6 +762,10 @@ schedLIORead(sched_root_task_t * __restrict root, sche if (lio_listio(LIO_NOWAIT, acb, nbufs, &sig)) { LOGERR; + for (i = 0; i < nbufs; i++) + if (acb[i]) + free(acb[i]); + free(acb); return NULL; } @@ -813,7 +817,7 @@ schedLIOWrite(sched_root_task_t * __restrict root, sch for (i = 0; i < nbufs; i++) if (acb[i]) free(acb[i]); - free(acb); + free(acb); return NULL; } else memset(acb[i], 0, sizeof(struct aiocb)); @@ -830,6 +834,10 @@ schedLIOWrite(sched_root_task_t * __restrict root, sch if (lio_listio(LIO_NOWAIT, acb, nbufs, &sig)) { LOGERR; + for (i = 0; i < nbufs; i++) + if (acb[i]) + free(acb[i]); + free(acb); return NULL; }