--- libaitio/src/sess.c 2013/03/19 17:02:58 1.2.2.1 +++ libaitio/src/sess.c 2014/02/08 22:06:17 1.5 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: sess.c,v 1.2.2.1 2013/03/19 17:02:58 misho Exp $ +* $Id: sess.c,v 1.5 2014/02/08 22:06:17 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 +Copyright 2004 - 2014 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -507,7 +507,7 @@ ipc_detachSession(sess_t * __restrict s) * @s = Session item * return: -1 null session item, 0 not attached, 1 attached memory */ -inline int +int sess_isAttached(sess_t * __restrict s) { if (!s) @@ -730,14 +730,11 @@ sess_GetValue(sess_t * __restrict s, const char *csAtt if (!s || !csAttr || !*csAttr) return -1; if (v) { - if (!*v) { - if (!(*v = ait_allocVar())) { - io_SetErr(elwix_GetErrno(), "%s", elwix_GetError()); - return -1; - } + if (!(*v = ait_allocVar())) { + io_SetErr(elwix_GetErrno(), "%s", elwix_GetError()); + return -1; } else - AIT_FREE_VAL(*v); - AIT_INIT_VAL2(*v, string); + AIT_INIT_VAL2(*v, string); } /* allocated memory & mirrored shared memory into this */ @@ -768,7 +765,6 @@ sess_GetValue(sess_t * __restrict s, const char *csAtt } e_free(Shared); - ait_freeVar(v); return 0; }