1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-02 13:05:08 +00:00

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

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: