diff --git a/ChangeLog b/ChangeLog index a5a455a..07866ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,13 @@ Version 1.6.16 ******************************************************************************* +2012-03-08 Fabrice Fontaine + + Memory leaks correction in upnpapi.c + + Fix memory leaks in UpnpUnSubscribe, SendActionExAsync and + RenewSubscription. + 2012-03-08 Fabrice Fontaine SF Bug Tracker id 3496993 - Write after free in ixmlNode_insertBefore diff --git a/upnp/src/api/upnpapi.c b/upnp/src/api/upnpapi.c index a9cc0d2..3bfdef6 100644 --- a/upnp/src/api/upnpapi.c +++ b/upnp/src/api/upnpapi.c @@ -1991,8 +1991,8 @@ int UpnpUnSubscribe(UpnpClient_Handle Hnd, const Upnp_SID SubsId) goto exit_function; } if (SubsId == NULL) { - HandleUnlock(); - return UPNP_E_INVALID_PARAM; + retVal = UPNP_E_INVALID_PARAM; + goto exit_function; } UpnpString_set_String(SubsIdTmp, SubsId); @@ -2075,7 +2075,7 @@ int UpnpUnSubscribeAsync( exit_function: UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__, "Exiting UpnpUnSubscribeAsync\n"); - return UPNP_E_SUCCESS; + return retVal; } #endif /* INCLUDE_CLIENT_APIS */ @@ -2093,7 +2093,8 @@ int UpnpRenewSubscription( UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__, "Inside UpnpRenewSubscription\n"); if (UpnpSdkInit != 1) { - return UPNP_E_FINISH; + retVal = UPNP_E_FINISH; + goto exit_function; } if (SubsIdTmp == NULL) { @@ -2719,6 +2720,7 @@ int UpnpSendActionExAsync( sizeof ( Param->ServiceType ) - 1 ); retVal = ixmlParseBufferEx( headerStr, &( Param->Header ) ); if( retVal != IXML_SUCCESS ) { + free( Param ); ixmlFreeDOMString( tmpStr ); ixmlFreeDOMString( headerStr ); if( retVal == IXML_INSUFFICIENT_MEMORY ) { @@ -2730,6 +2732,7 @@ int UpnpSendActionExAsync( retVal = ixmlParseBufferEx( tmpStr, &( Param->Act ) ); if( retVal != IXML_SUCCESS ) { + free( Param ); ixmlFreeDOMString( tmpStr ); ixmlFreeDOMString( headerStr ); ixmlDocument_free( Param->Header );