mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-24 04:45:41 +02:00
module/xkb: declare and initialize 'symbols' before first goto err
This ensures we don't free() an invalid value.
This commit is contained in:
parent
a8a9ab28bd
commit
c01806d6fa
1 changed files with 4 additions and 2 deletions
|
@ -143,6 +143,8 @@ get_layouts(xcb_connection_t *conn)
|
|||
for (ssize_t i = 0; i < ret.count; i++)
|
||||
group_name_cookies[i] = xcb_get_atom_name(conn, vlist.groups[i]);
|
||||
|
||||
char *symbols = NULL;
|
||||
|
||||
/* Get layout short names (e.g. "us") */
|
||||
xcb_get_atom_name_reply_t *atom_name = xcb_get_atom_name_reply(
|
||||
conn, symbols_name_cookie, &err);
|
||||
|
@ -152,8 +154,8 @@ get_layouts(xcb_connection_t *conn)
|
|||
goto err;
|
||||
}
|
||||
|
||||
char *symbols = strndup(xcb_get_atom_name_name(atom_name),
|
||||
xcb_get_atom_name_name_length(atom_name));
|
||||
symbols = strndup(xcb_get_atom_name_name(atom_name),
|
||||
xcb_get_atom_name_name_length(atom_name));
|
||||
free(atom_name);
|
||||
|
||||
/* Get layout long names (e.g. "English (US)") */
|
||||
|
|
Loading…
Add table
Reference in a new issue