aboutsummaryrefslogtreecommitdiff
path: root/lib/libcam/camlib.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2005-07-13 10:40:07 +0000
committerXin LI <delphij@FreeBSD.org>2005-07-13 10:40:07 +0000
commitae73eb3a7ff7f9cd5277fbbbee839fe7203e87db (patch)
tree321da183dcdfce50bead227fc8cbc472bed2fedc /lib/libcam/camlib.c
parentef95d02dd0f1c979cb5ccf7a0bffc0738e5dcc84 (diff)
Notes
Diffstat (limited to 'lib/libcam/camlib.c')
-rw-r--r--lib/libcam/camlib.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libcam/camlib.c b/lib/libcam/camlib.c
index 03754bb9a6209..c62d3a6c8ce0f 100644
--- a/lib/libcam/camlib.c
+++ b/lib/libcam/camlib.c
@@ -97,8 +97,7 @@ cam_getccb(struct cam_device *dev)
void
cam_freeccb(union ccb *ccb)
{
- if (ccb != NULL)
- free(ccb);
+ free(ccb);
}
/*
@@ -708,8 +707,7 @@ cam_close_device(struct cam_device *dev)
cam_close_spec_device(dev);
- if (dev != NULL)
- free(dev);
+ free(dev);
}
void
@@ -757,6 +755,11 @@ cam_device_dup(struct cam_device *device)
}
newdev = malloc(sizeof(struct cam_device));
+ if (newdev == NULL) {
+ snprintf(cam_errbuf, CAM_ERRBUF_SIZE,
+ "%s: couldn't malloc CAM device structure", func_name);
+ return(NULL);
+ }
bcopy(device, newdev, sizeof(struct cam_device));