--- libaitsess/src/aitsess.c 2012/02/28 13:00:24 1.5 +++ libaitsess/src/aitsess.c 2012/07/22 22:13:48 1.6 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitsess.c,v 1.5 2012/02/28 13:00:24 misho Exp $ +* $Id: aitsess.c,v 1.6 2012/07/22 22:13:48 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -109,7 +109,7 @@ sess_initSession(int id, const char *csFName, ait_sess } if (!*Sess) { - *Sess = malloc(sizeof(ait_sess_t)); + *Sess = io_malloc(sizeof(ait_sess_t)); if (!*Sess) { LOGERR; return -1; @@ -122,21 +122,21 @@ sess_initSession(int id, const char *csFName, ait_sess if (h == -1) { if (errno != EEXIST) { LOGERR; - free(*Sess); + io_free(*Sess); return -1; } /* If key file exist, session already connected */ h = open((*Sess)->name, O_RDONLY); if (h == -1) { LOGERR; - free(*Sess); + io_free(*Sess); return -1; } ret = read(h, szStr, sizeof szStr); if (ret == -1) { LOGERR; close(h); - free(*Sess); + io_free(*Sess); return -1; } if (!strncmp(szStr, "IPC@", 4) && id == SHARED_IPC) { @@ -165,7 +165,7 @@ sess_initSession(int id, const char *csFName, ait_sess sess_SetErr(EPROTONOSUPPORT, "Session type not supported or wrong session type"); close(h); - free(*Sess); + io_free(*Sess); return -1; } /* key found */ @@ -197,7 +197,7 @@ sess_initSession(int id, const char *csFName, ait_sess sess_SetErr(EINVAL, "Session type must be specified"); close(h); unlink(csFName); - free(*Sess); + io_free(*Sess); return -1; } strlcat(szStr, "ELWIX_Session ("PACKAGE_STRING")\n", sizeof szStr); @@ -234,7 +234,7 @@ sess_freeSession(ait_sess_t ** __restrict Sess) (*Sess)->type = SHARED_UNKNOWN; */ - free(*Sess); + io_free(*Sess); *Sess = NULL; }