diff options
author | Cyril Brulebois <kibi@debian.org> | 2010-11-10 16:06:10 +0100 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-11-11 08:22:59 +1000 |
commit | 99275ad2fa99778afaefc54b62c8638afc59e755 (patch) | |
tree | 19e6b6373fe5bd3850c42dc69ff085689807f19c /render | |
parent | 9e999d18b004b8ead9c6c5d79b4a3d4bbf0e3152 (diff) |
Remove superfluous if(p!=NULL) checks around free(p); p=NULL;
This patch has been generated by the following Coccinelle semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- free(E);
(
- E = NULL;
|
- E = 0;
)
- }
+ free(E);
+ E = NULL;
Signed-off-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'render')
-rw-r--r-- | render/miindex.c | 14 | ||||
-rw-r--r-- | render/picture.c | 7 |
2 files changed, 6 insertions, 15 deletions
diff --git a/render/miindex.c b/render/miindex.c index 5e2e06c35..4603136a4 100644 --- a/render/miindex.c +++ b/render/miindex.c @@ -322,16 +322,10 @@ void miCloseIndexed (ScreenPtr pScreen, PictFormatPtr pFormat) { - if (pFormat->index.devPrivate) - { - free(pFormat->index.devPrivate); - pFormat->index.devPrivate = 0; - } - if (pFormat->index.pValues) - { - free(pFormat->index.pValues); - pFormat->index.pValues = 0; - } + free(pFormat->index.devPrivate); + pFormat->index.devPrivate = NULL; + free(pFormat->index.pValues); + pFormat->index.pValues = NULL; } void diff --git a/render/picture.c b/render/picture.c index 7fda6b93a..896eaa7be 100644 --- a/render/picture.c +++ b/render/picture.c @@ -1391,11 +1391,8 @@ SetPictureTransform (PicturePtr pPicture, } else { - if (pPicture->transform) - { - free(pPicture->transform); - pPicture->transform = 0; - } + free(pPicture->transform); + pPicture->transform = NULL; } pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; |