mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-21 16:46:18 +00:00
Fix critical memory leak
This commit fixes a critical memory leak with the inserting RPC commands. We must initialize the cmd_flags with the delete key, otherwise they hang around in memory forever; potentially leaking significant amounts of resources.
This commit is contained in:
@@ -171,7 +171,8 @@ system_method_insert_object(const torrent::Object::list_type& args, int flags) {
|
|||||||
throw torrent::input_error("Invalid type.");
|
throw torrent::input_error("Invalid type.");
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmd_flags = 0;
|
// We must initialize this varriable to prevent a critical memory leak
|
||||||
|
int cmd_flags = rpc::CommandMap::flag_delete_key;
|
||||||
|
|
||||||
if (!(flags & rpc::object_storage::flag_static))
|
if (!(flags & rpc::object_storage::flag_static))
|
||||||
cmd_flags |= rpc::CommandMap::flag_modifiable;
|
cmd_flags |= rpc::CommandMap::flag_modifiable;
|
||||||
|
|||||||
Reference in New Issue
Block a user