Clean up file handle management.
authorGuy Harris <guy@alum.mit.edu>
Fri, 21 Oct 2016 22:29:59 +0000 (15:29 -0700)
committerGuy Harris <guy@alum.mit.edu>
Fri, 21 Oct 2016 22:30:39 +0000 (22:30 +0000)
commita6d81effbc23acce59fd88b8f828fe8c753eeb0d
tree0bf5ccc7dd8aca8697d50785d88ba0fe704b9f81
parent7f6a4926d2f6a135960146041c29802db616aa63
Clean up file handle management.

The main reason fclose() could fail is if the file is open for writing,
not all the buffered data has been written out at the time fclose() was
called, and the attempt to write it out fails.  In any case, the file
handle is no longer valid after fclose() completes, whether the close
succeeds or not, so there's no reason to keep it around.

There's no reason to check whether it's null in a loop called in code
where it's not null to start with and where it's not set to null in the
loop.

This should fix CID 1374111.

Change-Id: Ib8067a17731b41d6b184a5a415addc2ecaa7c00c
Reviewed-on: https://code.wireshark.org/review/18359
Reviewed-by: Guy Harris <guy@alum.mit.edu>
plugins/profinet/packet-dcerpc-pn-io.c