I can't figure out what is going on with this bit of code. I'm building a double linked list.
when i call this function inside my find/remove i get a seg fault.
Correct me if I'm wrong, but aren't you leaking here? You allocate memory to temp, then assign it a different address, thus losing the address of the memory you just allocated.
Secondly, you delete temp, which is holding the address of m_tail, so it is actually deleting m_tail, then you attempt to assign NULL to one of its data members.
Generally a list of this sort manages the memory for its nodes. Why, then, when you remove a node, is there no memory being deallocated?
In line 29 of removeFirstOccurrence you update trav->m_prev->m_next to point to trav->m_next. Where is the corresponding update for trav->m_next->m_prev?
Why are you allocating memory in removeAtTail and throwing it away?
You're using pointers rather haphazardly. I wouldn't be surprised to learn the problem was in another method.