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

Commit 9387288f authored by Janis Danisevskis's avatar Janis Danisevskis Committed by android-build-merger
Browse files

[automerger] Fix a memory leak in gatekeeper. am: 6a9c4e79 am: bdc924f3...

[automerger] Fix a memory leak in gatekeeper. am: 6a9c4e79 am: bdc924f3 am: 75359757 am: e126026c am: 4ae4ad8e am: b2598346 am: 20e73e23 am: ca662c71 am: 14d1d6ad
am: 4ea7584d

Change-Id: I2ae1881d76f2475a220221a0238f6e93ca504dbd
parents 1a630c36 4ea7584d
Loading
Loading
Loading
Loading
+4 −11
Original line number Original line Diff line number Diff line
@@ -58,23 +58,16 @@ public:
    virtual ~SoftGateKeeper() {
    virtual ~SoftGateKeeper() {
    }
    }


    virtual bool GetAuthTokenKey(const uint8_t **auth_token_key,
    virtual bool GetAuthTokenKey(const uint8_t** auth_token_key, uint32_t* length) const {
            uint32_t *length) const {
        if (auth_token_key == NULL || length == NULL) return false;
        if (auth_token_key == NULL || length == NULL) return false;
        uint8_t *auth_token_key_copy = new uint8_t[SIGNATURE_LENGTH_BYTES];
        *auth_token_key = key_.get();
        memcpy(auth_token_key_copy, key_.get(), SIGNATURE_LENGTH_BYTES);

        *auth_token_key = auth_token_key_copy;
        *length = SIGNATURE_LENGTH_BYTES;
        *length = SIGNATURE_LENGTH_BYTES;
        return true;
        return true;
    }
    }


    virtual void GetPasswordKey(const uint8_t** password_key, uint32_t* length) {
    virtual void GetPasswordKey(const uint8_t** password_key, uint32_t* length) {
        if (password_key == NULL || length == NULL) return;
        if (password_key == NULL || length == NULL) return;
        uint8_t *password_key_copy = new uint8_t[SIGNATURE_LENGTH_BYTES];
        *password_key = key_.get();
        memcpy(password_key_copy, key_.get(), SIGNATURE_LENGTH_BYTES);

        *password_key = password_key_copy;
        *length = SIGNATURE_LENGTH_BYTES;
        *length = SIGNATURE_LENGTH_BYTES;
    }
    }