From d658e46d995e6f9a643bf3ab19ef681dbbbfbb8d Mon Sep 17 00:00:00 2001 From: ru Date: Sun, 18 Jan 2004 12:32:06 +0000 Subject: [PATCH] Fixed a memory leak. Submitted by: Stanford Metacompilation research group --- sys/dev/ppbus/vpo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/ppbus/vpo.c b/sys/dev/ppbus/vpo.c index 99eed0784c05..47e8bc7c7cb5 100644 --- a/sys/dev/ppbus/vpo.c +++ b/sys/dev/ppbus/vpo.c @@ -186,7 +186,7 @@ static void vpo_cam_rescan(struct vpo_data *vpo) { struct cam_path *path; - union ccb *ccb = malloc(sizeof(union ccb), M_TEMP, M_WAITOK | M_ZERO); + union ccb *ccb; if (xpt_create_path(&path, xpt_periph, cam_sim_path(vpo->sim), 0, 0) != CAM_REQ_CMP) { @@ -194,6 +194,7 @@ vpo_cam_rescan(struct vpo_data *vpo) return; } + ccb = malloc(sizeof(union ccb), M_TEMP, M_WAITOK | M_ZERO); xpt_setup_ccb(&ccb->ccb_h, path, 5/*priority (low)*/); ccb->ccb_h.func_code = XPT_SCAN_BUS; ccb->ccb_h.cbfcnp = vpo_cam_rescan_callback;