Add a check for NULL incase smbios information is not populated
Details
Details
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
| sys/dev/acpi_support/acpi_ibm.c | ||
|---|---|---|
| 489–496 ↗ | (On Diff #6015) | Could you please do this instead to not leak a few bytes of memory (and make the code more readable)? /* Enable events by default */
...
/* Enable per-model events */
if (maker == NULL || product == NULL)
goto out;
for (i = 0; i < nitems(acpi_ibm_models); i++) {
...
}
out:
freeenv(maker);
freeenv(product); |
| sys/dev/acpi_support/acpi_ibm.c | ||
|---|---|---|
| 489–496 ↗ | (On Diff #6015) | The goto probably is more readable, but I don't think that it fixes a leak. The current patch still always calls freeenv() on both strings. |
| sys/dev/acpi_support/acpi_ibm.c | ||
|---|---|---|
| 489–496 ↗ | (On Diff #6015) | You're right.. I was thinking about an alternative method that isn't in place right now. |