mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-09 23:22:22 +00:00
Remove more superfluous if(p) checks around free(p)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
This commit is contained in:
parent
89bd05106e
commit
f4190feb25
11 changed files with 47 additions and 84 deletions
|
|
@ -114,10 +114,8 @@ register char *ptr;
|
|||
}
|
||||
if (freeAll) {
|
||||
(*num_inout)= (*sz_inout)= 0;
|
||||
if (*elems) {
|
||||
free(*elems);
|
||||
*elems= NULL;
|
||||
}
|
||||
free(*elems);
|
||||
*elems = NULL;
|
||||
}
|
||||
else if (first+count>=(*num_inout))
|
||||
*num_inout= first;
|
||||
|
|
@ -137,14 +135,10 @@ _XkbClearProperty(char *prop_in)
|
|||
{
|
||||
XkbPropertyPtr prop= (XkbPropertyPtr)prop_in;
|
||||
|
||||
if (prop->name) {
|
||||
free(prop->name);
|
||||
prop->name= NULL;
|
||||
}
|
||||
if (prop->value) {
|
||||
free(prop->value);
|
||||
prop->value= NULL;
|
||||
}
|
||||
free(prop->name);
|
||||
prop->name = NULL;
|
||||
free(prop->value);
|
||||
prop->value = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue