not sure you really need this as memory will be released anyway on exit  but if so  you do not need the if  tctx  guard as freecon null  like free null  is a no op and besides you aborted earlier if getcon failed 