]> granicus.if.org Git - nethack/commit
doset() -> special_handling() -> free(NULL)
authorPatR <rankin@nethack.org>
Wed, 11 Nov 2015 09:28:04 +0000 (01:28 -0800)
committerPatR <rankin@nethack.org>
Wed, 11 Nov 2015 09:28:04 +0000 (01:28 -0800)
commitcbeb562d2035576829b89aa0bfd9df58d1273890
treebb1eaa18e6f1a9d19ac4abd7abb698781dfc467d
parentb31033b7a0221ae27651f0568197cd698db160cd
doset() -> special_handling() -> free(NULL)

This isn't urgent, but I figure that until the mac build stuff gets
merged in, the core is still fair game....

'O' command's autopickup_exceptions was freeing a menu pick-list even
when it hadn't been allocated (for the list case, and for the remove
case if nothing was chosen for removal).  That code was evidently used
as the model for msgtype and menucolors; they had the same situation.

I think ANSI and ISO sanction free(NULL) as a no-op, but pre-ANSI free
implementations don't necessarily handle that benignly.  Even if they
all do, freeing something--even if that 'something' is nothing--which
hasn't been allocated is a bug on our end.
src/options.c