Repository: godot
Issue: Memory leak when executing ResourceLoader.load_threaded_request
Labels: bug,topic:core

**Godot version:**
4.0.dev.custom_build. afd0df792

**Issue description:**
Executing
```
ResourceLoader.load_threaded_request("ff")
```
cause memory leak
```
Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x7f0b1133e517 in malloc (/lib/x86_64-linux-gnu/libasan.so.6+0xb0517)
    #1 0x1298c259 in Memory::alloc_static(unsigned long, bool) core/os/memory.cpp:76
    #2 0x1298c16a in operator new(unsigned long, char const*) core/os/memory.cpp:41
    #3 0x12f989fa in ResourceLoader::load_threaded_request(String const&, String const&, bool, ResourceFormatLoader::CacheMode, String const&) core/io/resource_loader.cpp:370
    #4 0x12725d08 in _ResourceLoader::load_threaded_request(String const&, String const&, bool) core/core_bind.cpp:72
    #5 0x128aa620 in void call_with_variant_args_ret_helper<__UnexistingClass, Error, String const&, String const&, bool, 0ul, 1ul, 2ul>(__UnexistingClass*, Error (__UnexistingClass::*)(String const&, String const&, bool), Variant const**, Variant&, Callable::CallError&, IndexSequence<0ul, 1ul, 2ul>) core/variant/binder_common.h:563
    #6 0x1286e936 in void call_with_variant_args_ret_dv<__UnexistingClass, Error, String const&, String const&, bool>(__UnexistingClass*, Error (__UnexistingClass::*)(String const&, String const&, bool), Variant const**, int, Variant&, Callable::CallError&, Vector<Variant> const&) core/variant/binder_common.h:398
    #7 0x12836f29 in MethodBindTR<Error, String const&, String const&, bool>::call(Object*, Variant const**, int, Callable::CallError&) core/object/method_bind.h:451
    #8 0x13abf985 in Object::call(StringName const&, Variant const**, int, Callable::CallError&) core/object/object.cpp:784
    #9 0x1331996b in Variant::call(StringName const&, Variant const**, int, Variant&, Callable::CallError&) core/variant/variant_call.cpp:611
    #10 0x5bbb5a4 in GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) modules/gdscript/gdscript_vm.cpp:1372
    #11 0x56c4d93 in GDScriptInstance::call(StringName const&, Variant const**, int, Callable::CallError&) modules/gdscript/gdscript.cpp:1544
    #12 0x13b2b15d in ScriptInstance::call(StringName const&, Variant const&, Variant const&, Variant const&, Variant const&, Variant const&) core/object/script_language.cpp:322
    #13 0xc75fa8d in Node::_notification(int) scene/main/node.cpp:58
    #14 0x340c70f in Node::_notificationv(int, bool) scene/main/node.h:45
    #15 0x340efde in CanvasItem::_notificationv(int, bool) scene/main/canvas_item.h:164
    #16 0xe470038 in Node2D::_notificationv(int, bool) scene/2d/node_2d.h:37
    #17 0x13abfe1a in Object::notification(int, bool) core/object/object.cpp:793
    #18 0xc861073 in SceneTree::_notify_group_pause(StringName const&, int) scene/main/scene_tree.cpp:808
    #19 0xc854189 in SceneTree::process(float) scene/main/scene_tree.cpp:442
    #20 0x1fd1eca in Main::iteration() main/main.cpp:2489
    #21 0x1e78842 in OS_LinuxBSD::run() platform/linuxbsd/os_linuxbsd.cpp:261
    #22 0x1e6b040 in main platform/linuxbsd/godot_linuxbsd.cpp:58
    #23 0x7f0b104590b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)

```

https://github.com/godotengine/godot/blob/8faecd6a470aeef41084a32d74f4a131a5ef42b6/core/io/resource_loader.cpp#L370