Skip to content

Commit

Permalink
Fix a memory leak on X11 global shortcuts manager error
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fedin authored and john-preston committed Jun 24, 2024
1 parent aad13ae commit 72f43ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion base/platform/linux/base_global_shortcuts_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,11 @@ X11Manager::X11Manager()
sizeof(recordRange) / sizeof(recordRange[0]),
clientSpec,
recordRange);
if (xcb_request_check(_connection, createCookie)) {
if (const auto error = xcb_request_check(_connection, createCookie)) {
LOG((
"Global Shortcuts Manager: Could not create a record context!"));
_context = std::nullopt;
free(error);
return;
}

Expand Down

0 comments on commit 72f43ae

Please sign in to comment.