OSDN Git Service
(root)
/
android-x86
/
external-libdrm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
357ef59
)
tests/libkms-test-plane: fix possbile memory leak
author
Seung-Woo Kim
<sw0312.kim@samsung.com>
Thu, 25 Apr 2019 09:50:00 +0000
(18:50 +0900)
committer
Emil Velikov
<emil.l.velikov@gmail.com>
Thu, 25 Apr 2019 10:08:21 +0000
(11:08 +0100)
The pointer p aquired with drmModeGetPlane() is not free in error
path. Fix possible memory leak by calling drmModeFreePlane() in
the error path.
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
tests/kms/libkms-test-plane.c
patch
|
blob
|
history
diff --git
a/tests/kms/libkms-test-plane.c
b/tests/kms/libkms-test-plane.c
index
6c40a3c
..
4cb2737
100644
(file)
--- a/
tests/kms/libkms-test-plane.c
+++ b/
tests/kms/libkms-test-plane.c
@@
-55,8
+55,10
@@
static int kms_plane_probe(struct kms_plane *plane)
}
plane->formats = calloc(p->count_formats, sizeof(uint32_t));
- if (!plane->formats)
+ if (!plane->formats) {
+ drmModeFreePlane(p);
return -ENOMEM;
+ }
for (i = 0; i < p->count_formats; i++)
plane->formats[i] = p->formats[i];