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.
The
device_id
,group_id
, andvendor_name
can benull
pointer ifget_device_uid
,get_device_model_uid
,get_device_manufacturer
fails, whilefriendly_name
will always be assigned to a pointer pointing to a validCString
. As a result, the memory retrieve ofdevice_id
,group_id
, andvendor_name
should be done only when they are notnull
and we should always assertfriendly_name
points to a valid address.@padenot : I made a mistake to ask you change the
destroy_cubeb_device_info
. Here is a fix.