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:
Matt Turner 2010-06-10 04:08:54 +07:00 • committed by Mikhail Gusarov
commit f4190feb25
11 changed files with 47 additions and 84 deletions

View file

@ -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;
}