WMI: do not leak memory in parse_wdg()

If we _WDG returned object that is not buffer we were forgetting
to free memory allocated for that object.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
This commit is contained in:
Dmitry Torokhov 2010-08-26 00:14:58 -07:00 коммит произвёл Matthew Garrett
Родитель 4e4304d749
Коммит 64ed0ab8d0
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -825,8 +825,10 @@ static acpi_status parse_wdg(acpi_handle handle)
obj = (union acpi_object *) out.pointer;
if (obj->type != ACPI_TYPE_BUFFER)
return AE_ERROR;
if (obj->type != ACPI_TYPE_BUFFER) {
status = AE_ERROR;
goto out_free_pointer;
}
total = obj->buffer.length / sizeof(struct guid_block);