Skip to content
Snippets Groups Projects
Commit 8f37de51 authored by Ivo Ivanov's avatar Ivo Ivanov Committed by Alexandre Julliard
Browse files

winebus.sys: Fix memory leaks in bus_event_queue functions.

parent 5689ec7b
No related branches found
No related tags found
No related merge requests found
......@@ -329,7 +329,11 @@ BOOL bus_event_queue_device_removed(struct list *queue, struct unix_device *devi
struct bus_event *event = malloc(size);
if (!event) return FALSE;
if (unix_device_incref(device) == 1) return FALSE; /* being destroyed */
if (unix_device_incref(device) == 1) /* being destroyed */
{
free(event);
return FALSE;
}
event->type = BUS_EVENT_TYPE_DEVICE_REMOVED;
event->device = device;
......@@ -344,7 +348,11 @@ BOOL bus_event_queue_device_created(struct list *queue, struct unix_device *devi
struct bus_event *event = malloc(size);
if (!event) return FALSE;
if (unix_device_incref(device) == 1) return FALSE; /* being destroyed */
if (unix_device_incref(device) == 1) /* being destroyed */
{
free(event);
return FALSE;
}
event->type = BUS_EVENT_TYPE_DEVICE_CREATED;
event->device = device;
......@@ -360,7 +368,11 @@ BOOL bus_event_queue_input_report(struct list *queue, struct unix_device *device
struct bus_event *event = malloc(size);
if (!event) return FALSE;
if (unix_device_incref(device) == 1) return FALSE; /* being destroyed */
if (unix_device_incref(device) == 1) /* being destroyed */
{
free(event);
return FALSE;
}
event->type = BUS_EVENT_TYPE_INPUT_REPORT;
event->device = device;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment