refactor: avoid unnecessary heap alloc when sending magnet link over RPC (#3535)

This commit is contained in:
Charles Kerr 2022-07-27 23:31:41 -05:00 committed by GitHub
parent d8d03b8e3b
commit 88e898b005
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -626,9 +626,7 @@ static void initField(tr_torrent const* const tor, tr_stat const* const st, tr_v
break;
case TR_KEY_magnetLink:
str = tr_torrentGetMagnetLink(tor);
tr_variantInitStr(initme, str);
tr_free(str);
tr_variantInitStr(initme, tor->metainfo_.magnet());
break;
case TR_KEY_metadataPercentComplete: