Skip to content
Snippets Groups Projects
Commit a70e7720 authored by samm2's avatar samm2
Browse files

FreeBSD: fixing bug #29

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@3007 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 9b2973f8
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,8 @@ NOTES FOR FUTURE RELEASES: see TODO file.
<DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
[AS] FreeBSD: fixing crash on kFreeBSD (#29), patch provided by Petr Salinger
[CF] Makefile.am: 'make check' now tests the syntax of drivedb.h.
[CF] Cygwin: Open drive database files in text mode.
......
......@@ -165,7 +165,7 @@ private:
#ifdef __GLIBC__
static inline void * reallocf(void *ptr, size_t size) {
void *rv = realloc(ptr, size);
if(rv == NULL)
if((rv == NULL) && (size != 0))
free(ptr);
return rv;
}
......@@ -1800,10 +1800,10 @@ smart_device * freebsd_smart_interface::autodetect_smart_device(const char * nam
cam_close_device(cam_dev);
if(usbdevlist(bus,vendor_id, product_id, version)){
const char * usbtype = get_usb_dev_type_by_id(vendor_id, product_id, version);
if (!usbtype)
return false;
if (usbtype)
return get_sat_device(usbtype, new freebsd_scsi_device(this, name, ""));
}
return false;
}
#if FREEBSDVER > 800100
// check if we have ATA device connected to CAM (ada)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment