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

Commit bba9d27e authored by Narayan Kamath's avatar Narayan Kamath Committed by Android Git Automerger
Browse files

am 1d50879b: Merge "Remove memory leak in PersistentDataBlockService jni"

* commit '1d50879b':
  Remove memory leak in PersistentDataBlockService jni
parents a1867fb0 1d50879b
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include <android_runtime/AndroidRuntime.h>
#include <JNIHelp.h>
#include <jni.h>
#include <ScopedUtfChars.h>

#include <utils/misc.h>
#include <sys/ioctl.h>
@@ -77,8 +78,8 @@ namespace android {

    static jlong com_android_server_PersistentDataBlockService_getBlockDeviceSize(JNIEnv *env, jclass, jstring jpath)
    {
        const char *path = env->GetStringUTFChars(jpath, 0);
        int fd = open(path, O_RDONLY);
        ScopedUtfChars path(env, jpath);
        int fd = open(path.c_str(), O_RDONLY);

        if (fd < 0)
            return 0;
@@ -87,8 +88,8 @@ namespace android {
    }

    static int com_android_server_PersistentDataBlockService_wipe(JNIEnv *env, jclass, jstring jpath) {
        const char *path = env->GetStringUTFChars(jpath, 0);
        int fd = open(path, O_WRONLY);
        ScopedUtfChars path(env, jpath);
        int fd = open(path.c_str(), O_WRONLY);

        if (fd < 0)
            return 0;