summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@stoeckmann.org>2017-01-28 15:37:57 +0100
committerJulien Cristau <jcristau@debian.org>2017-01-28 15:37:57 +0100
commit87227e5fc79750d3eccc3c3482a3c5b3f2af2e90 (patch)
treeb61f3a8f2d12fcf333d21c4cf57f09d0349adcbb
parent5fb14f7a2c6da81c8e6bb325b354141233ab7d0a (diff)
Fix memory leak on error paths
Introduced in commit a0df3e1c7728205e5c7650b2e6dce684139254a6 "Avoid out of boundary accesses on illegal responses" Signed-off-by: Julien Cristau <jcristau@debian.org>
-rw-r--r--src/XrrCrtc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/XrrCrtc.c b/src/XrrCrtc.c
index 6665092..8316b78 100644
--- a/src/XrrCrtc.c
+++ b/src/XrrCrtc.c
@@ -459,6 +459,7 @@ XRRGetCrtcTransform (Display *dpy,
e = extra;
if (e + rep.pendingNbytesFilter > end) {
+ XFree (attr);
XFree (extra);
return False;
}
@@ -468,6 +469,7 @@ XRRGetCrtcTransform (Display *dpy,
for (p = 0; p < rep.pendingNparamsFilter; p++) {
INT32 f;
if (e + 4 > end) {
+ XFree (attr);
XFree (extra);
return False;
}
@@ -478,6 +480,7 @@ XRRGetCrtcTransform (Display *dpy,
attr->pendingNparams = rep.pendingNparamsFilter;
if (e + rep.currentNbytesFilter > end) {
+ XFree (attr);
XFree (extra);
return False;
}
@@ -487,6 +490,7 @@ XRRGetCrtcTransform (Display *dpy,
for (p = 0; p < rep.currentNparamsFilter; p++) {
INT32 f;
if (e + 4 > end) {
+ XFree (attr);
XFree (extra);
return False;
}