From 5c369848880051b35e722efbae94e11c29092a1f Mon Sep 17 00:00:00 2001 From: sos Date: Wed, 28 Jun 2006 15:04:10 +0000 Subject: Dont call free on non-alloc'd items. --- sys/dev/ata/atapi-cd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index bdfa167..1fd0929 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -1335,7 +1335,8 @@ acd_report_key(device_t dev, struct dvd_authinfo *ai) error = ata_atapicmd(dev, ccb, (caddr_t)d, length, ai->format == DVD_INVALIDATE_AGID ? 0 : ATA_R_READ,10); if (error) { - free(d, M_ACD); + if (length) + free(d, M_ACD); return error; } @@ -1377,7 +1378,8 @@ acd_report_key(device_t dev, struct dvd_authinfo *ai) default: error = EINVAL; } - free(d, M_ACD); + if (length) + free(d, M_ACD); return error; } -- cgit v1.1