This technique is talked about in this Stack Overflow answer: http://stackoverflow.com/questions/12914917/using-pointers-t..., which also references this Slashdot interview (http://meta.slashdot.org/story/12/10/11/0030249/linus-torval...) with Linus Torvalds where he gives this as his "favorite hack".
Re:Baby's First Garbage Collector
by munificent on Monday December 09, 2013 @11:59AM
(#6875164)
Yup, I got the idea for this from Linus. Before then, I've always done the uglier "if this is the first node then ..." special case branch instead.
It's a pointer to a pointer to handle the case where you're freeing the first object in the list. In that case, it's "firstObject" that needs to be modified, not some Object's "next" pointer.
Using a pointer to a pointer (while admittedly harder to read at first) lets you handle both of those cases with the same code.