mozilla / cubeb-coreaudio-rs

The audio backend of Firefox on Mac OS X.
ISC License
25 stars 10 forks source link

Revise `destroy_cubeb_device_info` #67

Closed ChunMinChang closed 4 years ago

ChunMinChang commented 4 years ago

The device_id, group_id, and vendor_name can be null pointer if get_device_uid, get_device_model_uid, get_device_manufacturer fails, while friendly_name will always be assigned to a pointer pointing to a valid CString. As a result, the memory retrieve of device_id, group_id, and vendor_name should be done only when they are not null and we should always assert friendly_name points to a valid address.

@padenot : I made a mistake to ask you change the destroy_cubeb_device_info. Here is a fix.