#fixed code
                                public static BytesStore<Bytes<Void>, Void> copyOf(Bytes bytes) {
        long remaining = bytes.readRemaining();
        NativeBytes<Void> bytes2 = Bytes.allocateElasticDirect(remaining);
        bytes2.write(bytes, 0, remaining);
        return bytes2;
    }
#vulnerable code 
                                public static BytesStore<Bytes<Void>, Void> copyOf(Bytes bytes) {
        long remaining = bytes.readRemaining();
        NativeBytes<Void> bytes2 = NativeBytes.nativeBytes(remaining);
        bytes2.write(bytes, 0, remaining);
        return bytes2;
    } 
                            #location 5 
                            #vulnerability type RESOURCE_LEAK