Start here

Home
About Klocwork
What's new
Fixed issues
Release notes
Installation

Reference

C/C++ checkers
Java checkers
C# checkers
MISRA C 2004 checkers
MISRA C++ 2008 checkers
MISRA C 2012 checkers
MISRA C 2012 checkers with Amendment 1
Commands
Metrics
Troubleshooting
Reference

Product components

C/C++ Integration build analysis
Java Integration build analysis
Desktop analysis
Refactoring
Klocwork Static Code Analysis
Klocwork Code Review
Structure101
Tuning
Custom checkers

Coding environments

Visual Studio
Eclipse for C/C++
Eclipse for Java
IntelliJ IDEA
Other

Administration

Project configuration
Build configuration
Administration
Analysis performance
Server performance
Security/permissions
Licensing
Klocwork Static Code Analysis Web API
Klocwork Code Review Web API

Community

View help online
Visit RogueWave.com
Klocwork Support
Rogue Wave Videos

Legal

Legal information

UF.SOCK

UF (Use Freed) issues are reported when there is an attempt to use resources after they were released. The UF.SOCK warning indicates an attempt to use a socket after it was closed.

Example 1

16     private Socket s;
17 
18     private void message(final Socket s, final String message) {
19         try {
20             s.getOutputStream().write(message.getBytes());
21         } catch (IOException e) {
22             try {
23                 s.close();
24             } catch (IOException e1) {
25                 //ignore
26             }
27         }
28     }
29 
30     public void handshake() {
31         message(s, "hello");
32     }
33 
34     public void requestData(final String key) throws IOException {
35         handshake();
36         message(s, "get_data[" + key + ']');
37     }

UF.SOCK is reported for the snippet on line 36: if an IOExcpetion is thrown on line 20, then 'socket' will be closed on line 23. However, the method 'message' called on line 36 will attempt to write into the socket whether it was closed or not.