mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-30 17:49:02 +00:00
Avoid leaking memory on invalid cursor commands
When a RedCursorCmd is passed to cursor_channel_process_cmd(), it constructs a new CursorItem which takes ownership of that command. If the cursor_cmd->type falls through to the default case of the switch statement, we will print a warning and return without freeing the CursorItem (and thus the RedCursorCmd). Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
e3bff1eea4
commit
7498675c1d
@ -335,6 +335,7 @@ void cursor_channel_process_cmd(CursorChannel *cursor, RedCursorCmd *cursor_cmd)
|
||||
break;
|
||||
default:
|
||||
spice_warning("invalid cursor command %u", cursor_cmd->type);
|
||||
cursor_item_unref(cursor_item);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user