Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57277659 authored by George Burgess's avatar George Burgess Committed by Automerger Merge Worker
Browse files

Merge "MTP: fix a memory leak" into sc-dev am: a66b6793 am: b600a54d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15325117

Change-Id: Id9f68b9722ad926fdacd15a6b68ee1afa1b22c4f
parents a2490dcd b600a54d
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -416,20 +416,14 @@ android_mtp_MtpDevice_set_device_property_init_version(JNIEnv *env, jobject thiz
        return -1;
    }

    MtpProperty* property = new MtpProperty(MTP_DEVICE_PROPERTY_SESSION_INITIATOR_VERSION_INFO,
                                            MTP_TYPE_STR, true);
    if (!property) {
        env->ThrowNew(clazz_io_exception, "Failed to obtain property.");
        return -1;
    }

    if (property->getDataType() != MTP_TYPE_STR) {
    MtpProperty property(MTP_DEVICE_PROPERTY_SESSION_INITIATOR_VERSION_INFO, MTP_TYPE_STR, true);
    if (property.getDataType() != MTP_TYPE_STR) {
        env->ThrowNew(clazz_io_exception, "Unexpected property data type.");
        return -1;
    }

    property->setCurrentValue(propertyStr);
    if (!device->setDevicePropValueStr(property)) {
    property.setCurrentValue(propertyStr);
    if (!device->setDevicePropValueStr(&property)) {
        env->ThrowNew(clazz_io_exception, "Failed to obtain property value.");
        return -1;
    }