i think decrease or clean the refcount before free is better, it looks more  comfortable since it has been increased.  just a suggest.