Ignore:
Timestamp:
Nov 7, 2007, 12:42:19 AM (15 years ago)
Author:
charles
Message:

fix crash reported by hussam in #transmission

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/upnp.c

    r3731 r3743  
    88 * the Transmission project.
    99 *
    10  * $Id:$
     10 * $Id$
    1111 */
    1212
     
    7171        char portStr[16];
    7272        snprintf( portStr, sizeof(portStr), "%d", handle->port );
    73         handle->isForwarding = UPNP_AddPortMapping( handle->urls.controlURL,
    74                                                     handle->data.servicetype,
    75                                                     portStr, portStr, handle->lanaddr,
    76                                                     "Transmission", "TCP" );
     73        handle->isForwarding = ( handle->urls.controlURL != NULL ) &&
     74                               ( handle->data.servicetype != NULL ) &&
     75                               ( UPNP_AddPortMapping( handle->urls.controlURL,
     76                                                      handle->data.servicetype,
     77                                                      portStr, portStr, handle->lanaddr,
     78                                                      "Transmission", "TCP" ) );
    7779
    7880        tr_dbg( "UPNP Port Forwarding via '%s', service '%s'.  (local address: %s:%d)",
Note: See TracChangeset for help on using the changeset viewer.