]> granicus.if.org Git - transmission/commitdiff
(trunk libT) heap pruning: using the same mechanism as in r12388, avoid an unnecessar...
authorJordan Lee <jordan@transmissionbt.com>
Wed, 27 Apr 2011 20:50:43 +0000 (20:50 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Wed, 27 Apr 2011 20:50:43 +0000 (20:50 +0000)
libtransmission/announcer-http.c

index b82611958a4f1589562a177f702a0b5808b51f9d..60cb71791b0329743e654dcd0a1b8a1e49e0123e 100644 (file)
@@ -211,9 +211,10 @@ on_announce_done( tr_session   * session,
 
         if( getenv( "TR_CURL_VERBOSE" ) != NULL )
         {
-            char * str = tr_bencToStr( &benc, TR_FMT_JSON, NULL );
-            fprintf( stderr, "Announce response:\n< %s\n", str );
-            tr_free( str );
+            struct evbuffer * buf = evbuffer_new( );
+            tr_bencToBuf( &benc, TR_FMT_JSON, buf );
+            fprintf( stderr, "Announce response:\n< %s\n", evbuffer_pullup( buf, -1 ) );
+            tr_free( buf );
         }
 
         if( benc_loaded && tr_bencIsDict( &benc ) )