Fix potential double fclose in test_extras (cordtest)
authorIvan Maidanski <ivmai@mail.ru>
Wed, 24 Oct 2012 04:29:42 +0000 (08:29 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 24 Oct 2012 11:11:57 +0000 (15:11 +0400)
commit247bf4eec9bf2514a23f208f8e2da725ecaa3fba
tree03d4261b987454a321ecd26f6f86f52455b87093
parent7edcba978ab71e11e5f5451cb280316e5325681a
Fix potential double fclose in test_extras (cordtest)

* cord/tests/cordtest.c (test_extras): Explicitly clear cord handles
obtained from CORD_from_file(), invoke GC_gcollect and
GC_invoke_finalizers to force f1a, f1b, f2 handles to be closed before
removing the files; remove the second attempts to remove the files on
rename failure (print a warning instead) as it might cause double
fclose (or double free); add comments.
cord/tests/cordtest.c