From: Ivo Ivanov logos128@gmail.com
Signed-off-by: Ivo Ivanov logos128@gmail.com Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/winebus.sys/unixlib.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/dlls/winebus.sys/unixlib.c b/dlls/winebus.sys/unixlib.c index ea26094049e..f66fd78d176 100644 --- a/dlls/winebus.sys/unixlib.c +++ b/dlls/winebus.sys/unixlib.c @@ -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;