according to the man pages.... * dirname() can not return NULL * the pointer returned by dirname must not be free()d * strdup() can return NULL