am 27eb205e
: Merge "MtpDatabase JNI: Fixed a memory-leak in getObjectPropertyValue()."
* commit '27eb205e21e7715764084085f382d690e0406c63': MtpDatabase JNI: Fixed a memory-leak in getObjectPropertyValue().
This commit is contained in:
@ -431,16 +431,14 @@ MtpResponseCode MyMtpDatabase::getObjectPropertyValue(MtpObjectHandle handle,
|
||||
case MTP_TYPE_STR:
|
||||
{
|
||||
jstring stringValue = (jstring)env->GetObjectArrayElement(stringValuesArray, 0);
|
||||
const char* str = (stringValue ? env->GetStringUTFChars(stringValue, NULL) : NULL);
|
||||
if (stringValue) {
|
||||
const char* str = env->GetStringUTFChars(stringValue, NULL);
|
||||
if (str == NULL) {
|
||||
return MTP_RESPONSE_GENERAL_ERROR;
|
||||
}
|
||||
packet.putString(str);
|
||||
env->ReleaseStringUTFChars(stringValue, str);
|
||||
} else {
|
||||
packet.putEmptyString();
|
||||
}
|
||||
env->DeleteLocalRef(stringValue);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
Reference in New Issue
Block a user