From 0a4d8cbdcd7b25313fb29ccdb498044af95f7de6 Mon Sep 17 00:00:00 2001 From: Mikhail Gusarov Date: Sun, 6 Jun 2010 15:28:30 +0700 Subject: Remove more superfluous if(p) checks around free(p) This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ -if(E) { free(E); } +free(E); Signed-off-by: Mikhail Gusarov Reviewed-by: Julien Cristau Reviewed-by: Fernando Carrijo Reviewed-by: Matt Turner --- dbe/dbe.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'dbe') diff --git a/dbe/dbe.c b/dbe/dbe.c index ef4b596c4..b4b746678 100644 --- a/dbe/dbe.c +++ b/dbe/dbe.c @@ -693,10 +693,7 @@ ProcDbeGetVisualInfo(ClientPtr client) if (!(pScrVisInfo = (XdbeScreenVisualInfo *)malloc(count * sizeof(XdbeScreenVisualInfo)))) { - if (pDrawables) - { - free(pDrawables); - } + free(pDrawables); return(BadAlloc); } @@ -722,10 +719,7 @@ ProcDbeGetVisualInfo(ClientPtr client) } /* Free pDrawables if we needed to allocate it above. */ - if (pDrawables) - { - free(pDrawables); - } + free(pDrawables); return (rc == Success) ? BadAlloc : rc; } @@ -803,10 +797,7 @@ ProcDbeGetVisualInfo(ClientPtr client) } free(pScrVisInfo); - if (pDrawables) - { - free(pDrawables); - } + free(pDrawables); return Success; -- cgit v1.2.3