Shouldn't this be estrdup() ?