summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-04-13 15:13:06 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-04-15 14:38:04 -0700
commitef95f1c3737d9efc7d97fb1784f80ef3540a846b (patch)
treeba2b0391cec7b0076d44233e85d9aa9b1acd21c2
parent6772336755c6eb5b46c471dd5ae2ac89101ed179 (diff)
When Xcalloc() returns NULL, you don't need to Xfree() it
I have no words to explain how this ever happened. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/XF86VMode.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/XF86VMode.c b/src/XF86VMode.c
index 4f19cf3..c0e50e6 100644
--- a/src/XF86VMode.c
+++ b/src/XF86VMode.c
@@ -256,7 +256,6 @@ XF86VidModeGetModeLine(Display* dpy, int screen, int* dotclock,
if (modeline->privsize > 0) {
if (!(modeline->private = Xcalloc(modeline->privsize, sizeof(INT32)))) {
_XEatData(dpy, (modeline->privsize) * sizeof(INT32));
- Xfree(modeline->private);
return False;
}
_XRead(dpy, (char*)modeline->private, modeline->privsize * sizeof(INT32));
@@ -321,7 +320,6 @@ XF86VidModeGetAllModeLines(Display* dpy, int screen, int* modecount,
_XEatData(dpy, (rep.modecount) * sizeof(xXF86OldVidModeModeInfo));
else
_XEatData(dpy, (rep.modecount) * sizeof(xXF86VidModeModeInfo));
- Xfree(modelines);
return False;
}
mdinfptr = (XF86VidModeModeInfo *) (
@@ -353,7 +351,6 @@ XF86VidModeGetAllModeLines(Display* dpy, int screen, int* modecount,
if (!(modelines[i]->private =
Xcalloc(oldxmdline.privsize, sizeof(INT32)))) {
_XEatData(dpy, (oldxmdline.privsize) * sizeof(INT32));
- Xfree(modelines[i]->private);
} else {
_XRead(dpy, (char*)modelines[i]->private,
oldxmdline.privsize * sizeof(INT32));
@@ -384,7 +381,6 @@ XF86VidModeGetAllModeLines(Display* dpy, int screen, int* modecount,
if (!(modelines[i]->private =
Xcalloc(xmdline.privsize, sizeof(INT32)))) {
_XEatData(dpy, (xmdline.privsize) * sizeof(INT32));
- Xfree(modelines[i]->private);
} else {
_XRead(dpy, (char*)modelines[i]->private,
xmdline.privsize * sizeof(INT32));
@@ -1039,7 +1035,6 @@ XF86VidModeGetDotClocks(Display* dpy, int screen, int *flagsPtr,
if (!(dotclocks = (int*) Xcalloc(rep.clocks, sizeof(int)))) {
_XEatData(dpy, (rep.clocks) * 4);
- Xfree(dotclocks);
return False;
}