RELIABILITY: Fix memory leaks and dereferences of uninitialized pointers.
authorBen Pfaff <blp@cs.stanford.edu>
Thu, 4 Apr 2013 16:26:03 +0000 (11:26 -0500)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 4 Apr 2013 16:29:33 +0000 (11:29 -0500)
commit412577e8dc5b7bea03d7a3fff5b9cc0325903654
treee1ff9b661ff7206f7edf6c8a8b7b6afa85d78f97
parent3465d0d0743b7bc81a7bda309cbe2cfc8c9f7ec0
RELIABILITY: Fix memory leaks and dereferences of uninitialized pointers.

The 'total' struct and 'm' array in struct reliability were allocated once
per case group, but freed exactly once.  If there were no case groups,
this caused a null dereference.  If there was more than one case group,
this caused a memory leak.  This commit fixes both problems.

This commit also fixes a related crash on bad syntax due to dereferencing
a null pointer in reliability_destroy().

Bug #38660.
Reported by William Rogers.
src/language/stats/reliability.c
tests/language/stats/reliability.at