Attention is currently required from: Nico Huber, Edward O'Callaghan, Anastasia Klimchuk.
View Change
1 comment:
File flashrom.c:
Patch Set #2, Line 558:
if (data)
free(data);
The check is redundant. Remember that CB:54905 has an explanation? 😊
<randomthoughts>
What would cause problems (undefined behavior) is passing a non-NULL but invalid pointer:
- A pointer not returned by an allocation function: malloc(), calloc(), realloc(), etc.
- A pointer to dynamically-allocated memory that free() or realloc() has already released.
There's no way to know this from within this function, though. And it would be a bug in the programmer code anyway. I'd add a comment explaining this, but we know what happens with comments: no one reads them, but when someone does, the comment is rotten (outdated and/or wrong). I mean, the comment right below mentions an atexit() function, which no longer exists...
</randomthoughts>
To view, visit change 54890. To unsubscribe, or for help writing mail filters, visit settings.
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I8b20717ba549e12edffbc5d1643ff064a4f0c517
Gerrit-Change-Number: 54890
Gerrit-PatchSet: 2
Gerrit-Owner: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@mailbox.org>
Gerrit-Attention: Nico Huber <nico.h@gmx.de>
Gerrit-Attention: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Attention: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Comment-Date: Fri, 04 Jun 2021 08:45:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment