diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-10 14:23:11 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-11 15:36:06 -0800 |
commit | 5655379ce89ab55f25a536972aaa310480de9432 (patch) | |
tree | aa9cffb76485caf32da96d8d689f5a0ce6ab6c11 /keycodes.c | |
parent | 2ac6a7f029d8855fbb4e8024aab0511727ac3a67 (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 'keycodes.c')
-rw-r--r-- | keycodes.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -270,8 +270,7 @@ AddIndicatorName(KeyNamesInfo * info, IndicatorNameInfo * new) static void ClearKeyNamesInfo(KeyNamesInfo * info) { - if (info->name != NULL) - free(info->name); + free(info->name); info->name = NULL; info->computedMax = info->explicitMax = info->explicitMin = -1; info->computedMin = 256; @@ -517,8 +516,7 @@ HandleIncludeKeycodes(IncludeStmt * stmt, XkbDescPtr xkb, KeyNamesInfo * info) HandleKeycodesFile(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; } |