Quick and dirty malloc() support for realpath.

Mike Frysinger vapier at gentoo.org
Wed Oct 28 09:12:55 UTC 2009


On Wednesday 28 October 2009 04:57:01 Peter Kjellerstedt wrote:
> From: Mike Frysinger
> 
> [ cut ]
> 
> > @@ -114,6 +114,8 @@ char got_path[];
> >  		while (*path != '\0' && *path != '/') {
> >  			if (new_path > max_path) {
> >  				__set_errno(ENAMETOOLONG);
> > + err:
> > +				free(allocated_path);
> >  				return NULL;
> 
> Fore readability, wouldn't it be better to put the three lines
> above at the end of the function, and just put another goto err
> here? Or is there some other reason to have the error exit path
> in the middle of the function?

i stated the reason for doing this in the part you "[ cut ]".  it was all of 
two sentences :P.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/uclibc/attachments/20091028/b79eea8d/attachment.pgp>


More information about the uClibc mailing list