Your fail. tpath has not been initialized and hence is a vagabonding pointer. Use
Code:
STRING* tpath = str_create("#32");
// The rest of your code goes here...
ptr_remove(tpath);


instead.


Always learn from history, to be sure you make the same mistakes again...