Check for non-existing model DMI string.

Submitted by:	ganbold
Found with:	Coverity Prevent(tm)
CID:         	2434
MFC after:	1 week
This commit is contained in:
Rui Paulo 2008-11-29 14:20:36 +00:00
parent 6179164448
commit 4710587722

View File

@ -254,6 +254,9 @@ asmc_match(device_t dev)
char *model;
model = getenv("smbios.system.product");
if (model == NULL)
return (NULL);
for (i = 0; asmc_models[i].smc_model; i++) {
if (!strncmp(model, asmc_models[i].smc_model, strlen(model))) {
freeenv(model);