[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: New version of function mkdirhier()

On Fri, 2012-01-13 at 11:18 +0100, Samuel Thibault wrote:
> Svante Signell, le Fri 13 Jan 2012 10:33:23 +0100, a écrit :

> Err, why not? mkdirhier does not need to return anything to the caller,
> so it can allocate/free at will. Isn't it possible to simply use
> src = strdup(path)?

The problem is that in the end of the routine the src pointer does not
point to the originally allocated address, so it  has to be reset to the
start before freeing. Otherwise the result is a segfault. I did not
succeed to do that properly.

Reply to: