diff --git a/linux/device.c b/linux/device.c index 977cf03..58f287c 100644 --- a/linux/device.c +++ b/linux/device.c @@ -247,6 +247,18 @@ int32_t GetDeviceType(void* device_ctx) if(!chrptr) { chrptr = strrchr(dev_path, '.'); + if(!chrptr) + { + free((void*)sysfs_path); + free((void*)dev_path); + free((void*)host_no); + free((void*)iscsi_path); + free((void*)scsi_path); + free((void*)spi_path); + free((void*)fc_path); + free((void*)sas_path); + return dev_type; + } } chrptr--;