A: 

Well . . . it looks like you're double-freeing the data pointer:

pushStack( stack, letter );
...
free( letter );
...
free( stack->top->dataPointer ); //(in destroyStack)

So, I would start by removing the free( letter ) line.

Bob
That won't work since each element of the stack would still end up with the `dataPointer` referencing the same address. It would still crash when attempting to free the 2nd element's `dataPtr` and only store a single value for all elements of the stack.
torak
+3  A: 

Your problem is with letter. It's only allocated once and when you push it onto the stack, it doesn't make a copy. That's why your top data pointer is always the last thing you pushed. Then you free it and destroyStack frees it and you get another error. Since the stack functions were from your assignment, the fix is to allocate a new data pointer inside the loop every iteration and ensure that it's not freed outside of destroyStack.

Nathon
And that was it. I had the free( letter ) in there to free up the memory and let the pointer then be used for showing the top data point in the stack. I didn't even think about the fact that I was re-using the same piece of memory in quite a few locations, then destroying it and trying to read from it. Thanks!
tjsimmons
A: 

Look at how many int sized pieces of memory you've allocated. I think you'll need to allocate a new one for each entry you push onto the stack.

Darron