free c pointer after create