system/core
リビジョン | e126026c02919b9c45e2559431fe67ea8dc6457e (tree) |
---|---|
日時 | 2019-06-21 07:31:15 |
作者 | Android Build Merger (Role) <noreply-android-build-merger@goog...> |
コミッター | Android Build Merger (Role) |
[automerger] Fix a memory leak in gatekeeper. am: 6a9c4e7968 am: bdc924f31d am: 7535975701
Change-Id: I25e3d526bb3f09c826d204909ea1763af4eb951d
@@ -58,23 +58,16 @@ public: | ||
58 | 58 | virtual ~SoftGateKeeper() { |
59 | 59 | } |
60 | 60 | |
61 | - virtual bool GetAuthTokenKey(const uint8_t **auth_token_key, | |
62 | - uint32_t *length) const { | |
61 | + virtual bool GetAuthTokenKey(const uint8_t** auth_token_key, uint32_t* length) const { | |
63 | 62 | if (auth_token_key == NULL || length == NULL) return false; |
64 | - uint8_t *auth_token_key_copy = new uint8_t[SIGNATURE_LENGTH_BYTES]; | |
65 | - memcpy(auth_token_key_copy, key_.get(), SIGNATURE_LENGTH_BYTES); | |
66 | - | |
67 | - *auth_token_key = auth_token_key_copy; | |
63 | + *auth_token_key = key_.get(); | |
68 | 64 | *length = SIGNATURE_LENGTH_BYTES; |
69 | 65 | return true; |
70 | 66 | } |
71 | 67 | |
72 | - virtual void GetPasswordKey(const uint8_t **password_key, uint32_t *length) { | |
68 | + virtual void GetPasswordKey(const uint8_t** password_key, uint32_t* length) { | |
73 | 69 | if (password_key == NULL || length == NULL) return; |
74 | - uint8_t *password_key_copy = new uint8_t[SIGNATURE_LENGTH_BYTES]; | |
75 | - memcpy(password_key_copy, key_.get(), SIGNATURE_LENGTH_BYTES); | |
76 | - | |
77 | - *password_key = password_key_copy; | |
70 | + *password_key = key_.get(); | |
78 | 71 | *length = SIGNATURE_LENGTH_BYTES; |
79 | 72 | } |
80 | 73 |