Skip to content

Commit 4a38d3c

Browse files
committed
Release correlation ID result
1 parent 4be4edd commit 4a38d3c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

common/main/cpp/native_c4replicator.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "native_glue.hh"
2222
#include "native_c4replutils.hh"
2323
#include "socket_factory.h"
24+
#include "fleece/FLSlice.h"
2425
#include "com_couchbase_lite_internal_core_impl_NativeC4Replicator.h"
2526

2627
using namespace litecore;
@@ -610,9 +611,11 @@ Java_com_couchbase_lite_internal_core_impl_NativeC4Replicator_getCorrelationId(
610611
jclass ignored,
611612
jlong repl) {
612613
auto result = c4repl_getCorrelationID((C4Replicator *)repl);
613-
return result
614+
auto retVal = result
614615
? UTF8ToJstring(env, (const char *)result.buf, result.size)
615616
: nullptr;
617+
FLSliceResult_Release(result);
618+
return retVal;
616619
}
617620

618621
/*

0 commit comments

Comments
 (0)