Skip to content

Commit 4cfde10

Browse files
Android: Fix memory leak in DnssdImpl.cpp ChipDnssdStopBrowse() (#32855)
* Android: Fix memory leak in ChipDnssdStopBrowse - Addressed comment by bzbarsky-apple * Addressed comment by bzbarsky-apple simplified
1 parent cd0e262 commit 4cfde10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/platform/android/DnssdImpl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,14 @@ CHIP_ERROR ChipDnssdStopBrowse(intptr_t browseIdentifier)
219219

220220
env->CallVoidMethod(sBrowserObject.ObjectRef(), sStopBrowseMethod, reinterpret_cast<jlong>(ctx->callback));
221221

222+
chip::Platform::Delete(ctx);
222223
if (env->ExceptionCheck())
223224
{
224225
ChipLogError(Discovery, "Java exception in ChipDnssdStopBrowse");
225226
env->ExceptionDescribe();
226227
env->ExceptionClear();
227228
return CHIP_JNI_ERROR_EXCEPTION_THROWN;
228229
}
229-
chip::Platform::Delete(ctx);
230230

231231
return CHIP_NO_ERROR;
232232
}

0 commit comments

Comments
 (0)