aboutsummaryrefslogtreecommitdiffstats
path: root/testing/alttab/0002-Remove-check-around-free.patch
blob: a3f26b3b905d843fcc287f9f897c35df3a1a4b88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From f7e8ff30190a3134863d7ff03becc2e397ec9db0 Mon Sep 17 00:00:00 2001
From: Michael Vetter <jubalh@iodoru.org>
Date: Thu, 3 Oct 2019 17:20:40 +0200
Subject: [PATCH] Remove check around free()

free(NULL) is noop. We don't need to check for this.
---
 src/randr.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/randr.c b/src/randr.c
index e4ebe9d..0622c73 100644
--- a/src/randr.c
+++ b/src/randr.c
@@ -186,8 +186,7 @@ bool randrGetViewport(quad * res, bool * multihead)
     if (no < 1) {
         msg(0, "randr didn't detect any output\n");
         *multihead = false;
-        if (oq != NULL)
-            free(oq);
+        free(oq);
         return false;
     }
     if (no == 1) {
-- 
2.24.0