Skip to content

Commit

Permalink
Android: Fix memory leak in DnssdImpl.cpp ChipDnssdStopBrowse() (proj…
Browse files Browse the repository at this point in the history
…ect-chip#32855)

* Android: Fix memory leak in ChipDnssdStopBrowse - Addressed comment by bzbarsky-apple

* Addressed comment by bzbarsky-apple simplified
  • Loading branch information
pgregorr-amazon authored Apr 4, 2024
1 parent cd0e262 commit 4cfde10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/platform/android/DnssdImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,14 @@ CHIP_ERROR ChipDnssdStopBrowse(intptr_t browseIdentifier)

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

chip::Platform::Delete(ctx);
if (env->ExceptionCheck())
{
ChipLogError(Discovery, "Java exception in ChipDnssdStopBrowse");
env->ExceptionDescribe();
env->ExceptionClear();
return CHIP_JNI_ERROR_EXCEPTION_THROWN;
}
chip::Platform::Delete(ctx);

return CHIP_NO_ERROR;
}
Expand Down

0 comments on commit 4cfde10

Please sign in to comment.