From 8541d7479378b1be3127ad8cae4534b5b2e2b4fa Mon Sep 17 00:00:00 2001 From: seiyap70 Date: Mon, 7 Nov 2016 14:07:56 +0800 Subject: [PATCH] free the info resource if failed free the info resource if failed --- libtransmission/torrent-magnet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libtransmission/torrent-magnet.c b/libtransmission/torrent-magnet.c index 7b6ed8549..fc606c1d4 100644 --- a/libtransmission/torrent-magnet.c +++ b/libtransmission/torrent-magnet.c @@ -308,6 +308,8 @@ tr_torrentSetMetadataPiece (tr_torrent * tor, int piece, const void * data, in tr_sessionSetTorrentFile (tor->session, tor->info.hashString, tor->info.torrent); tr_torrentGotNewInfoDict (tor); tr_torrentSetDirty (tor); + }else{ + tr_metainfoFree(&info); } tr_variantFree (&newMetainfo); -- 2.40.0