If you look above, it's allocated with strndup() , which returns a pointer that must be free-d, not deleted.