diff options
author | Hung Nguyen <hung.nguyen@sonymobile.com> | 2012-06-05 13:19:53 +0200 |
---|---|---|
committer | James Dong <jdong@google.com> | 2013-01-24 15:42:42 -0800 |
commit | 0bf43848adb00922122b0a0eed2fa0318bde8317 (patch) | |
tree | b8b0ca3491d76059f03e97f695949876b6e153bc /drm/common/IDrmManagerService.cpp | |
parent | 13f7fe763b9ad52fc27f21ed923c46b9555a321f (diff) | |
download | frameworks_av-0bf43848adb00922122b0a0eed2fa0318bde8317.zip frameworks_av-0bf43848adb00922122b0a0eed2fa0318bde8317.tar.gz frameworks_av-0bf43848adb00922122b0a0eed2fa0318bde8317.tar.bz2 |
Fixed memory leakage in the DRM framework
Change-Id: Ib1276bec6cafb4e94f8f13b52e50e4987765eec4
Diffstat (limited to 'drm/common/IDrmManagerService.cpp')
-rw-r--r-- | drm/common/IDrmManagerService.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drm/common/IDrmManagerService.cpp b/drm/common/IDrmManagerService.cpp index 0282036..91fd91e 100644 --- a/drm/common/IDrmManagerService.cpp +++ b/drm/common/IDrmManagerService.cpp @@ -190,8 +190,9 @@ DrmConstraints* BpDrmManagerService::getConstraints( if (0 < bufferSize) { data = new char[bufferSize]; reply.read(data, bufferSize); + drmConstraints->put(&key, data); + delete[] data; } - drmConstraints->put(&key, data); } } return drmConstraints; @@ -219,8 +220,9 @@ DrmMetadata* BpDrmManagerService::getMetadata(int uniqueId, const String8* path) if (0 < bufferSize) { data = new char[bufferSize]; reply.read(data, bufferSize); + drmMetadata->put(&key, data); + delete[] data; } - drmMetadata->put(&key, data); } } return drmMetadata; @@ -889,9 +891,11 @@ status_t BnDrmManagerService::onTransact( int bufferSize = 0; if (NULL != value) { bufferSize = strlen(value); + reply->writeInt32(bufferSize + 1); + reply->write(value, bufferSize + 1); + } else { + reply->writeInt32(0); } - reply->writeInt32(bufferSize + 1); - reply->write(value, bufferSize + 1); } } delete drmConstraints; drmConstraints = NULL; |