Skip to content

Commit

Permalink
chore(linux): Unnecessary to check for NULL before calling g_free
Browse files Browse the repository at this point in the history
`g_free` will return if the parameter is NULL, so we don't have to
check for that.

See glib [documentation](https://docs.gtk.org/glib/func.free.html).
  • Loading branch information
ermshiperete committed Oct 16, 2023
1 parent b0dd74c commit 0eb5065
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions linux/ibus-keyman/src/keymanutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ void free_cust_kbd(gpointer data) {

g_free(kbd_data->kb_id_with_lang);
g_free(kbd_data->lang->id);
if (kbd_data->lang->name)
g_free(kbd_data->lang->name);
g_free(kbd_data->lang->name);
g_free(kbd_data->lang);
g_free(kbd_data);
}
Expand Down

0 comments on commit 0eb5065

Please sign in to comment.