Hi,

On 28-07-16 19:31, walter harms wrote:

janitorial patch: remove some unneeded if() before free()

This is not free() but Xfree() and "man Xfree" states:

"A NULL pointer cannot be passed to this function."

Regards,

Hans




---
 src/XrrScreen.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/XrrScreen.c b/src/XrrScreen.c
index f29071c..b8ce7e5 100644
--- a/src/XrrScreen.c
+++ b/src/XrrScreen.c
@@ -127,8 +127,8 @@ doGetScreenResources (Display *dpy, Window window, int poll)
     xrsr = (XRRScreenResources *) Xmalloc(rbytes);
     wire_names = (char *) Xmalloc (rep.nbytesNames);
     if (xrsr == NULL || wire_names == NULL) {
-       if (xrsr) Xfree (xrsr);
-       if (wire_names) Xfree (wire_names);
+       Xfree (xrsr);
+       Xfree (wire_names);
        _XEatDataWords (dpy, rep.length);
        UnlockDisplay (dpy);
        SyncHandle ();

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to