Patch for bad close of file descriptor

Hi, Clang

Here is a small patch for StreamChecker to check the double close of fp.

man fclose:

The behaviour of fclose() is undefined if the stream parameter is an illegal pointer, or is a descriptor already passed to a previous invocation of fclose().

It adds several states to file descriptor(just like what already done in MallocChecker).

I’ll appreciate it if there are any advice about this patch.

FileDoubleClose.patch (5.59 KB)

Hi Lei,

Looks good. I applied it with minor corrections. The test case is not
complete. The warning message is in the wrong line. This can be
spotted by running 'make test'.