axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject cvs commit: ws-axis/c/src/common AxisConfig.cpp
Date Wed, 01 Sep 2004 09:22:33 GMT
samisa      2004/09/01 02:22:32

  Modified:    c/src/common AxisConfig.cpp
  Log:
  Fixed memeory leaks in the readConfFile caused due the non allocation of memory allocated
to hold
  conf file path name
  
  Revision  Changes    Path
  1.45      +11 -4     ws-axis/c/src/common/AxisConfig.cpp
  
  Index: AxisConfig.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/common/AxisConfig.cpp,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- AxisConfig.cpp	17 Aug 2004 14:11:10 -0000	1.44
  +++ AxisConfig.cpp	1 Sep 2004 09:22:32 -0000	1.45
  @@ -106,8 +106,11 @@
   	Even if the AXISCPP_DEPLOY environment variable is not set default values 
   	will be used. Therefore return AXIS_SUCCESS
   	*/
  -    if (!sConfPath || (sConfPath == '\0') )
  -		return AXIS_SUCCESS;
  +    if (!sConfPath || (sConfPath == '\0') ) 
  +    {
  +        free(sNewConfPath);
  +        return AXIS_SUCCESS;
  +    }
       m_pcAxisHome = (char*) malloc (CONFBUFFSIZE);
       strcpy (m_pcAxisHome, sConfPath);
   
  @@ -122,7 +125,10 @@
   	will be used. Therefore return AXIS_SUCCESS
   	*/
       if (AXIS_SUCCESS != fileConfig.fileOpen(sNewConfPath, "r"))
  -		return AXIS_SUCCESS;
  +    {
  +        free(sNewConfPath);
  +        return AXIS_SUCCESS;
  +    }
   
       while (AXIS_SUCCESS == fileConfig.fileGet(carrLine, CONFBUFFSIZE)) 
       {
  @@ -152,6 +158,7 @@
   		free(key);
       }
   
  +    free(sNewConfPath);
       return AXIS_SUCCESS;
   }
   
  @@ -185,4 +192,4 @@
   
   */
   
  -AXIS_CPP_NAMESPACE_END
  \ No newline at end of file
  +AXIS_CPP_NAMESPACE_END
  
  
  

Mime
View raw message