summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwalter harms <wharms@bfs.de>2016-07-28 19:32:46 +0200
committerHans de Goede <hdegoede@redhat.com>2016-08-15 08:56:13 +0200
commit8ac94020b018105240ea45a87df2603d1eb5808b (patch)
tree815280ea671d85476aa40e3a237f77804dffc9f1 /src
parent4ed36e386b21c1a65d614d5bf2b2c82d1e74ae2e (diff)
fix: redundant null check on calling free()
janitorial patch: remove some unneeded if() before free() Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/XrrMonitor.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/XrrMonitor.c b/src/XrrMonitor.c
index 71d3943..a9eaa7b 100644
--- a/src/XrrMonitor.c
+++ b/src/XrrMonitor.c
@@ -84,8 +84,8 @@ XRRGetMonitors(Display *dpy, Window window, Bool get_active, int *nmonitors)
mon = Xmalloc (rbytes);
if (buf == NULL || mon == NULL) {
- if (buf != NULL) Xfree(buf);
- if (mon != NULL) Xfree(mon);
+ Xfree(buf);
+ Xfree(mon);
_XEatDataWords (dpy, rep.length);
UnlockDisplay (dpy);
SyncHandle ();
@@ -194,7 +194,6 @@ XRRAllocateMonitor(Display *dpy, int noutput)
void
XRRFreeMonitors(XRRMonitorInfo *monitors)
{
- if (monitors)
- Xfree(monitors);
+ Xfree(monitors);
}