summaryrefslogtreecommitdiff
path: root/compat.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-12-10 14:23:11 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-12-11 15:36:06 -0800
commit5655379ce89ab55f25a536972aaa310480de9432 (patch)
treeaa9cffb76485caf32da96d8d689f5a0ce6ab6c11 /compat.c
parent2ac6a7f029d8855fbb4e8024aab0511727ac3a67 (diff)
Remove unnecessary checks for NULL pointers before calling free()
Not needed in C89 and later Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'compat.c')
-rw-r--r--compat.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/compat.c b/compat.c
index 5475a75..479c8d2 100644
--- a/compat.c
+++ b/compat.c
@@ -133,8 +133,7 @@ InitCompatInfo(CompatInfo * info, XkbDescPtr xkb)
static void
ClearCompatInfo(CompatInfo * info, XkbDescPtr xkb)
{
- if (info->name != NULL)
- free(info->name);
+ free(info->name);
info->name = NULL;
info->dflt.defs.defined = 0;
info->dflt.defs.merge = MergeAugment;
@@ -425,8 +424,7 @@ HandleIncludeCompatMap(IncludeStmt * stmt,
(*hndlr) (rtrn, xkb, MergeOverride, &included);
if (stmt->stmt != NULL)
{
- if (included.name != NULL)
- free(included.name);
+ free(included.name);
included.name = stmt->stmt;
stmt->stmt = NULL;
}
@@ -880,7 +878,6 @@ CompileCompatMap(XkbFile * file,
ClearCompatInfo(&info, xkb);
return True;
}
- if (info.interps != NULL)
- free(info.interps);
+ free(info.interps);
return False;
}