Actions
Bug #6659
closednvlist_free(NULL) is a no-op
Start date:
2016-02-15
Due date:
% Done:
100%
Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:
External Bug:
Description
There are a lot of places in the gate that conditionally call nvlist_free() to avoid passing a NULL pointer. It turns out that nvlist_free(NULL) is a no-op (much like free(NULL)), so we can safely remove the condition in the callers.
The change was generated using the Coccinelle patch (see attached) and then tweaked a little by hand to nuke some useless whitespace.
Files
Updated by Josef Sipek over 7 years ago
- File patch2.cocci patch2.cocci added
Second semantic patch to catch more "bad" users of nvlist_free()
Updated by Electric Monk over 7 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
git commit aab83bb83be7342f6cfccaed8d5fe0b2f404855d
commit aab83bb83be7342f6cfccaed8d5fe0b2f404855d Author: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Date: 2016-02-27T16:52:10.000Z 6659 nvlist_free(NULL) is a no-op Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Marcel Telka <marcel@telka.sk> Approved by: Robert Mustacchi <rm@joyent.com>
Actions