Ticket #482: tracker.c.patch

File tracker.c.patch, 1.0 KB (added by szsuj, 14 years ago)

patch file for libtransmission/tracker.c

  • tracker.c

    old new  
    882882    struct evhttp_connection * evcon;
    883883    const tr_torrent * tor;
    884884
     885    /** added by sunny, 2007/11/15
     886     * to make the redirect works
     887    **/
     888    if(t->redirect)
     889        address = t->redirect;
     890
    885891    tor = tr_torrentFindFromHash( t->handle, t->hash );
    886892    if( tor == NULL )
    887893        return FALSE;   
     
    904910        tr_free( uri );
    905911    } else {
    906912        struct evhttp_request * req;
     913
     914        /** Modified by sunny, 2007/11/15
     915         *  to avoid the copy of freed memory
     916        **/
     917        char * tmp_eventName = tr_strdup(eventName);
    907918        tr_free( t->lastRequest );
    908         t->lastRequest = tr_strdup( eventName );
     919        t->lastRequest = tmp_eventName;
     920
    909921        if( isStopping ) {
    910922            evhttp_connection_set_timeout( evcon, STOP_TIMEOUT_INTERVAL_SEC );
    911923            req = evhttp_request_new( onStoppedResponse, t->handle );