You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by cb...@apache.org on 2005/04/25 19:38:20 UTC

cvs commit: ws-axis/c/src/soap SoapDeSerializer.cpp

cblecken    2005/04/25 10:38:20

  Modified:    c/src/soap SoapDeSerializer.cpp
  Log:
  This should be the fix for AXISCPP-625, where the xsi:nill attribute will cause a 4 byte
  memory leak.
  
  PR: AXSICPP-625
  Submitted by:cblecken
  
  Revision  Changes    Path
  1.159     +46 -29    ws-axis/c/src/soap/SoapDeSerializer.cpp
  
  Index: SoapDeSerializer.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapDeSerializer.cpp,v
  retrieving revision 1.158
  retrieving revision 1.159
  diff -u -r1.158 -r1.159
  --- SoapDeSerializer.cpp	23 Mar 2005 15:44:59 -0000	1.158
  +++ SoapDeSerializer.cpp	25 Apr 2005 17:38:19 -0000	1.159
  @@ -1204,12 +1204,16 @@
                               m_pCurrNode = m_pNode;\
                               /* Need to verify if the return value is NULL. */\
                               xsd__boolean * isNill = getAttributeAsBoolean("nil", 0);\
  -                            if (NULL != isNill && true_ == *isNill)\
  -                            {\
  -                                ((cpp_type*)Array.m_Array)[nIndex] = NULL;\
  -                                m_pNode = m_pParser->next();\
  -                                m_pNode = NULL;\
  -                                continue;\
  +                            if (NULL != isNill) {\
  +                            	if (true_ == *isNill) {\
  +                          	      ((cpp_type*)Array.m_Array)[nIndex] = NULL;\
  +                            	    m_pNode = m_pParser->next();\
  +                                	m_pNode = NULL;\
  +	                                delete isNill;\
  +    	                            continue;\
  +        	                    } else {\
  +            	                	delete isNill;\
  +                	            }\
                               }\
                           }\
                           m_pNode = m_pParser->next(true); /* charactor node */\
  @@ -1690,8 +1694,11 @@
           		{
           		    m_pParser->next ();
           		    m_pNode = NULL;
  +                    delete isNill;
           		    return NULL;
  -        		}
  +        		} else {
  +        			delete isNill;
  +        		}	
               }
   	    }
   	    m_pNode = NULL;	/* node identified and used */
  @@ -1824,16 +1831,20 @@
   	     */
   	    if (0 != m_pNode->m_pchAttributes[0])
   	    {
  -		m_pCurrNode = m_pNode;
  -		/*
  -		 * Need to verify if the return value is NULL.
  -		 */
  -		if (*(getAttributeAsBoolean ("nil", 0)) == true_)
  -		{
  -		    m_pParser->next ();
  -		    m_pNode = NULL;
  -		    return NULL;
  -		}
  +			m_pCurrNode = m_pNode;
  +			xsd__boolean * isNill = getAttributeAsBoolean("nil", 0);
  +            if (NULL != isNill)
  +            {
  +                if(true_ == *isNill)
  +        		{
  +        		    m_pParser->next ();
  +        		    m_pNode = NULL;
  +                    delete isNill;
  +        		    return NULL;
  +        		} else {
  +        			delete isNill;
  +        		}
  +            }
   	    }
   	    m_pNode = NULL;	/* node identified and used */
   	    void *pObject = ((AXIS_OBJECT_CREATE_FUNCT) pCreFunct)
  @@ -3501,12 +3512,15 @@
                * Need to verify if the return value is NULL.
                */
               xsd__boolean * isNill = getAttributeAsBoolean("nil", 0);
  -            if (NULL != isNill && true_ == *isNill)
  -            {
  -                m_pNode = m_pParser->next();
  -                m_pNode = NULL;
  -                return ret;
  -            }
  +            if(true_ == *isNill)
  +    		{
  +    		    m_pParser->next ();
  +    		    m_pNode = NULL;
  +                delete isNill;
  +    		    return NULL;
  +    		} else {
  +    			delete isNill;
  +    		}
           }
   
           m_pNode = m_pParser->next (true);    /* charactor node */
  @@ -3615,12 +3629,15 @@
                * Need to verify if the return value is NULL.
                */
               xsd__boolean * isNill = getAttributeAsBoolean("nil", 0);
  -            if (NULL != isNill && true_ == *isNill)
  -            {
  -                m_pNode = m_pParser->next();
  -                m_pNode = NULL;
  -                return ret;
  -            }
  +            if(true_ == *isNill)
  +    		{
  +    		    m_pParser->next ();
  +    		    m_pNode = NULL;
  +                delete isNill;
  +    		    return NULL;
  +    		} else {
  +    			delete isNill;
  +    		}
           }
   
           m_pNode = m_pParser->next (true);	/* charactor node */