global c pointer was not nullified after memory deallocation