fix crash on shutdown on natpmp routers reported by SoftwareElves

This commit is contained in:
Charles Kerr
2007-12-13 20:19:52 +00:00
parent 449186969f
commit bddcf5e10d
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -85,7 +85,9 @@ void
tr_natpmpClose( tr_natpmp * nat )
{
assert( !nat->isMapped );
assert( ( nat->state == TR_NATPMP_IDLE ) || ( nat->state == TR_NATPMP_ERR ) );
assert( ( nat->state == TR_NATPMP_IDLE )
|| ( nat->state == TR_NATPMP_ERR )
|| ( nat->state == TR_NATPMP_DISCOVER ) );
closenatpmp( &nat->natpmp );
tr_free( nat );
+3 -1
View File
@@ -65,7 +65,9 @@ void
tr_upnpClose( tr_upnp * handle )
{
assert( !handle->isMapped );
assert( ( handle->state == TR_UPNP_IDLE ) || ( handle->state == TR_UPNP_ERR ) );
assert( ( handle->state == TR_UPNP_IDLE )
|| ( handle->state == TR_UPNP_ERR )
|| ( handle->state == TR_UPNP_DISCOVER ) );
if( handle->hasDiscovered )
FreeUPNPUrls( &handle->urls );