mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-21 22:09:23 +01:00
hwsim: Fix leak of send_frame_info->user_data
In case the genl object is cleaned up prior to the callback being called, the DBus message might get leaked. Can only happen in bizarre cases.
This commit is contained in:
parent
f22ec55efb
commit
17f55f3b4a
@ -1208,6 +1208,8 @@ static void send_custom_frame_callback(struct l_genl_msg *msg, void *user_data)
|
||||
struct l_dbus_message *message = info->user_data;
|
||||
struct l_dbus_message *reply;
|
||||
|
||||
info->user_data = NULL;
|
||||
|
||||
if (l_genl_msg_get_error(msg) < 0) {
|
||||
/* Radio address or frequency didn't match */
|
||||
l_debug("HWSIM_CMD_FRAME failed for destination %s: %d",
|
||||
@ -1226,6 +1228,9 @@ static void send_custom_frame_destroy(void *user_data)
|
||||
{
|
||||
struct send_frame_info *info = user_data;
|
||||
|
||||
if (info->user_data)
|
||||
l_dbus_message_unref(info->user_data);
|
||||
|
||||
l_free(info->frame);
|
||||
l_free(info->radio);
|
||||
l_free(info);
|
||||
|
Loading…
Reference in New Issue
Block a user