mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-02-05 04:06:11 -05:00
xwm: don't leak msg in case of realloc failure
This commit is contained in:
parent
f735439543
commit
b7312b4f95
1 changed files with 3 additions and 2 deletions
|
|
@ -1775,11 +1775,12 @@ static void xwm_handle_net_startup_info_message(struct wlr_xwm *xwm,
|
|||
char *start;
|
||||
size_t buf_len = sizeof(ev->data);
|
||||
if (curr) {
|
||||
curr->msg = realloc(curr->msg, curr->len + buf_len);
|
||||
if (!curr->msg) {
|
||||
char *msg = realloc(curr->msg, curr->len + buf_len);
|
||||
if (!msg) {
|
||||
pending_startup_id_destroy(curr);
|
||||
return;
|
||||
}
|
||||
curr->msg = msg;
|
||||
start = curr->msg + curr->len;
|
||||
curr->len += buf_len;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue