FACTOR: Avoid freeing indeterminate pointer.
authorBen Pfaff <blp@gnu.org>
Mon, 15 Feb 2010 22:41:55 +0000 (14:41 -0800)
committerBen Pfaff <blp@gnu.org>
Mon, 15 Feb 2010 22:41:55 +0000 (14:41 -0800)
commit200dd4d96febeef4ed0720dfca7fa988676c6afe
tree7d5e23a85a9cb043d51c344287c844e3520e8e05
parent006bed0af6dede3b1307e3eb635fe037076bebd6
FACTOR: Avoid freeing indeterminate pointer.

The first test in cmd_factor() is:
    if (!lex_force_match_id (lexer, "VARIABLES"))

If this fails, then control jumps to the "error" label, which frees
factor.vars, which has not been initialized at this point.

This commit fixes the problem by initializing factor.vars to NULL.  It is
not strictly necessary to also initialize factor.n_vars to 0, but it seems
like a good idea.

Found by Clang (http://clang-analyzer.llvm.org).
src/language/stats/factor.c