UF (Use Freed) issues are reported when there is an attempt to use resources after they were released. The ANDROID.UF.MEDIARECORDER warning indicates an attempt to use MediaRecorder after it was released.

Example 1

     public boolean onKeyDown(final int keyCode, final KeyEvent event) {
         if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
             MediaRecorder mRecorder = new MediaRecorder();
             final File file = new File("test.raw");
             if (file.exists()) {
             } else {
             return true;
         return super.onKeyDown(keyCode, event);

ANDROID.UF.MEDIARECORDER is reported for the snippet on line 30 since there is an attempt to use the 'mRecorder' that is released if the output file exists (line 25).


This checker can be extended through the Klocwork knowledge base. See Tuning Java analysis for more information.