Wireshark-commits: [Wireshark-commits] master a6d81ef: Clean up file handle management.
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=a6d81effbc23acce59fd88b8f828fe8c753eeb0d
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark
Commits:
a6d81ef by Guy Harris (guy@xxxxxxxxxxxx):
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@xxxxxxxxxxxx>
Actions performed:
from 7f6a492 test: make GTK support optional
adds a6d81ef Clean up file handle management.
Summary of changes:
plugins/profinet/packet-dcerpc-pn-io.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)