Remove more superfluous if(p!=NULL) checks around free(p).
This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ - if (E != NULL) - free(E); + free(E); Signed-off-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
0649ac0afd
commit
b142b0d274
|
@ -117,10 +117,7 @@ CreateGrab(
|
||||||
static void
|
static void
|
||||||
FreeGrab(GrabPtr pGrab)
|
FreeGrab(GrabPtr pGrab)
|
||||||
{
|
{
|
||||||
if (pGrab->modifiersDetail.pMask != NULL)
|
|
||||||
free(pGrab->modifiersDetail.pMask);
|
free(pGrab->modifiersDetail.pMask);
|
||||||
|
|
||||||
if (pGrab->detail.pMask != NULL)
|
|
||||||
free(pGrab->detail.pMask);
|
free(pGrab->detail.pMask);
|
||||||
|
|
||||||
if (pGrab->cursor)
|
if (pGrab->cursor)
|
||||||
|
|
|
@ -377,7 +377,6 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap)
|
||||||
|
|
||||||
__GLX_SEND_HEADER();
|
__GLX_SEND_HEADER();
|
||||||
WriteToClient(client, length, (char *) string);
|
WriteToClient(client, length, (char *) string);
|
||||||
if (buf != NULL)
|
|
||||||
free(buf);
|
free(buf);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
|
|
|
@ -2964,7 +2964,6 @@ xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon)
|
||||||
int size;
|
int size;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (output->MonInfo != NULL)
|
|
||||||
free(output->MonInfo);
|
free(output->MonInfo);
|
||||||
|
|
||||||
output->MonInfo = edid_mon;
|
output->MonInfo = edid_mon;
|
||||||
|
|
|
@ -215,7 +215,7 @@ void miAppendSpans(SpanGroup *spanGroup, SpanGroup *otherGroup, Spans *spans)
|
||||||
|
|
||||||
void miFreeSpanGroup(SpanGroup *spanGroup)
|
void miFreeSpanGroup(SpanGroup *spanGroup)
|
||||||
{
|
{
|
||||||
if (spanGroup->group != NULL) free(spanGroup->group);
|
free(spanGroup->group);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void QuickSortSpansX(
|
static void QuickSortSpansX(
|
||||||
|
|
|
@ -92,7 +92,6 @@ RootlessUpdateScreenPixmap(ScreenPtr pScreen)
|
||||||
rowbytes = PixmapBytePad(pScreen->width, pScreen->rootDepth);
|
rowbytes = PixmapBytePad(pScreen->width, pScreen->rootDepth);
|
||||||
|
|
||||||
if (s->pixmap_data_size < rowbytes) {
|
if (s->pixmap_data_size < rowbytes) {
|
||||||
if (s->pixmap_data != NULL)
|
|
||||||
free(s->pixmap_data);
|
free(s->pixmap_data);
|
||||||
|
|
||||||
s->pixmap_data_size = rowbytes;
|
s->pixmap_data_size = rowbytes;
|
||||||
|
|
2
os/log.c
2
os/log.c
|
@ -489,7 +489,6 @@ AuditFlush(OsTimerPtr timer, CARD32 now, pointer arg)
|
||||||
ErrorF("%slast message repeated %d times\n",
|
ErrorF("%slast message repeated %d times\n",
|
||||||
prefix != NULL ? prefix : "", nrepeat);
|
prefix != NULL ? prefix : "", nrepeat);
|
||||||
nrepeat = 0;
|
nrepeat = 0;
|
||||||
if (prefix != NULL)
|
|
||||||
free(prefix);
|
free(prefix);
|
||||||
return AUDIT_TIMEOUT;
|
return AUDIT_TIMEOUT;
|
||||||
} else {
|
} else {
|
||||||
|
@ -523,7 +522,6 @@ VAuditF(const char *f, va_list args)
|
||||||
nrepeat = 0;
|
nrepeat = 0;
|
||||||
auditTimer = TimerSet(auditTimer, 0, AUDIT_TIMEOUT, AuditFlush, NULL);
|
auditTimer = TimerSet(auditTimer, 0, AUDIT_TIMEOUT, AuditFlush, NULL);
|
||||||
}
|
}
|
||||||
if (prefix != NULL)
|
|
||||||
free(prefix);
|
free(prefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -292,10 +292,8 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys;
|
||||||
}
|
}
|
||||||
type= &xkb->map->types[type_ndx];
|
type= &xkb->map->types[type_ndx];
|
||||||
if (map_count==0) {
|
if (map_count==0) {
|
||||||
if (type->map!=NULL)
|
|
||||||
free(type->map);
|
free(type->map);
|
||||||
type->map= NULL;
|
type->map= NULL;
|
||||||
if (type->preserve!=NULL)
|
|
||||||
free(type->preserve);
|
free(type->preserve);
|
||||||
type->preserve= NULL;
|
type->preserve= NULL;
|
||||||
type->map_count= 0;
|
type->map_count= 0;
|
||||||
|
|
|
@ -267,7 +267,6 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
|
||||||
strncpy(nameRtrn,keymap,nameRtrnLen);
|
strncpy(nameRtrn,keymap,nameRtrnLen);
|
||||||
nameRtrn[nameRtrnLen-1]= '\0';
|
nameRtrn[nameRtrnLen-1]= '\0';
|
||||||
}
|
}
|
||||||
if (buf != NULL)
|
|
||||||
free(buf);
|
free(buf);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -287,7 +286,6 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
|
||||||
}
|
}
|
||||||
if (nameRtrn)
|
if (nameRtrn)
|
||||||
nameRtrn[0]= '\0';
|
nameRtrn[0]= '\0';
|
||||||
if (buf != NULL)
|
|
||||||
free(buf);
|
free(buf);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue