Memory leak found in resource_stream