[systemd-devel] [PATCH 2/2] sysv-generator: remove NULL pointer dereference

Thomas H.P. Andersen phomes at gmail.com
Sun Apr 26 12:04:02 PDT 2015


On Sun, Apr 26, 2015 at 8:31 PM, Thomas H.P. Andersen <phomes at gmail.com> wrote:
> On Sun, Apr 26, 2015 at 8:23 PM, Shawn Landden <shawn at churchofgit.com> wrote:
>> Actually you missed that free_sysvstub_hashmap does not tolerate NULL pointers.
> Indeed. I will commit that.

Wait. free_sysvstub_hashmapp does tolerate NULL pointers.

hashmap_steal_first will return NULL if the hashmap is NULL. And
hashmap_free is fine with NULL too. Your patch makes it more obvious
that free_sysvstub_hashmapp does tolerate NULL but destructors should
tolerate NULL as per the coding style. So I guess it should just be
assumed? I will leave it up to the others to decide what the best
style is here.


More information about the systemd-devel mailing list