Fix a memory leak on invalid expressions
commit2fded4c68e277ef33a81675dc630c07f41dd9b19
authorPetr Tesarik <petr@tesarici.cz>
Tue, 16 Oct 2012 04:16:44 +0000 (16 06:16 +0200)
committerPetr Tesarik <petr@tesarici.cz>
Tue, 16 Oct 2012 04:16:44 +0000 (16 06:16 +0200)
treeb8a1e25fa9b1e4e9dd0d05ce79cddf9a8a487e10
parent56343ee766052316732a73d27ff43ae3805d63a1
Fix a memory leak on invalid expressions

The code in reduce_stack() could leak one atom if there was only atom
in the expression list, because it removed the first atom and then
didn't free it when checking for the presence of a second atom.

Fix this by rewriting the list_empty() condition so that it checks for
less than 2 items.
libhed/expr.c