diff --git a/core/jni/android_hardware_location_ContextHubService.cpp b/core/jni/android_hardware_location_ContextHubService.cpp index 9515a0e336aa5..7a8a574b119e3 100644 --- a/core/jni/android_hardware_location_ContextHubService.cpp +++ b/core/jni/android_hardware_location_ContextHubService.cpp @@ -603,6 +603,8 @@ static void passOnOsResponse(uint32_t hubHandle, uint32_t msgType, env->CallIntMethod(db.jniInfo.jContextHubService, db.jniInfo.contextHubServiceMsgReceiptCallback, jheader, jmsg); + env->DeleteLocalRef(jmsg); + env->DeleteLocalRef(jheader); delete[] msg; }