You see in the sample code you have posted- at Line 2 - tempClob is null and its initialized only in the try block. But when its being used in the catch block it may be or may not be initialized.
May be because- CLOB.createTemporary successfully executes.
May not be because- there was some exception while executing CLOB.createTemporary and hence tempClob is not initialized.
So in you catch you need to check if tempClob is initialized before you execute tasks of cleaning.
But the cleanup has to be done in finally - catch block may not be executed when there is no exception. But finally block is always executed. So you have to add