diff options
author | Gubbala Venugopal Rao <vgubba@codeaurora.org> | 2014-03-12 15:15:08 +0530 |
---|---|---|
committer | Scott Mertz <scott@cyngn.com> | 2014-09-23 14:26:22 -0700 |
commit | d0ba759dff652100cb249df1733da89311f355b8 (patch) | |
tree | 232a65734f3961a67066a9c1e441262cca14d9a0 | |
parent | 1c1919892885d0b7eb73d382f3d1370b47ff820e (diff) | |
download | android_packages_apps_Bluetooth-d0ba759dff652100cb249df1733da89311f355b8.tar.gz android_packages_apps_Bluetooth-d0ba759dff652100cb249df1733da89311f355b8.tar.bz2 android_packages_apps_Bluetooth-d0ba759dff652100cb249df1733da89311f355b8.zip |
Bluetooth: Update proper delete calls in AVRCP JNI
Avoid delete[] to free the pointers which are not created
by using new[].
Change-Id: I8f03335445b3c1b169c2905ec9daa4ec16dcc13c
CRs-Fixed: 629728
-rw-r--r-- | jni/com_android_bluetooth_avrcp.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/jni/com_android_bluetooth_avrcp.cpp b/jni/com_android_bluetooth_avrcp.cpp index c59252be8..56a89b7f2 100644 --- a/jni/com_android_bluetooth_avrcp.cpp +++ b/jni/com_android_bluetooth_avrcp.cpp @@ -522,7 +522,7 @@ static jboolean SendCurrentPlayerValueRspNative(JNIEnv *env, jobject object , } attr = env->GetByteArrayElements(value, NULL); if (!attr) { - delete[] pAttrs; + delete pAttrs; jniThrowIOException(env, EINVAL); return JNI_FALSE; } @@ -536,7 +536,7 @@ static jboolean SendCurrentPlayerValueRspNative(JNIEnv *env, jobject object , BT_STATUS_SUCCESS) { ALOGE("Failed get_player_app_value_rsp, status: %d", status); } - delete[] pAttrs; + delete pAttrs; env->ReleaseByteArrayElements(value, attr, 0); return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE; } @@ -752,7 +752,7 @@ static jboolean registerNotificationPlayerAppRspNative(JNIEnv *env, jobject obje } attr = env->GetByteArrayElements(value, NULL); if (!attr) { - delete[] param; + delete param; jniThrowIOException(env, EINVAL); return JNI_FALSE; } @@ -768,7 +768,7 @@ static jboolean registerNotificationPlayerAppRspNative(JNIEnv *env, jobject obje BT_STATUS_SUCCESS) { ALOGE("Failed register_notification_rsp, status: %d", status); } - delete[] param; + delete param; env->ReleaseByteArrayElements(value, attr, 0); return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE; } |