Like Salem said "freeing something that wasn't allocated to begin with" will cause a seg fault which is the case here.

You are using makeEmpty before T is initialized. When using pointers, you should follow the guideline that a pointer should always point to a) valid memory or b) NULL. When you call makeEmpty, T is pointing to garbage. You can google "dangling pointers" for more information about why this is bad.