Nicolas Iooss 278ae562d6 libsepol: fix potential free of uninitialized pointer
When using "gcc -O2 -Wall -Werror" to compile libsepol, the following
error happens:

  services.c: In function 'constraint_expr_eval_reason':
  services.c:820:2: error: 'answer_list' may be used uninitialized in this
  function [-Werror=maybe-uninitialized]
    free(answer_list);
    ^

Indeed, because of a goto statement in constraint_expr_eval_reason
function, "free(answer_list)" can be called before answer_list has been
initialized.

Fix this error by moving the definition of answer_list to the beginning
of constraint_expr_eval_reason.

Acked-by: Steve Lawrence <slawrence@tresys.com>
2014-10-02 09:53:19 -04:00
..
2014-08-26 08:03:31 -04:00
2014-08-26 08:03:31 -04:00
2014-08-27 11:47:04 -04:00
2014-08-26 08:03:31 -04:00
2014-08-27 11:47:04 -04:00