it does look peculiar - but if you check the man page for getenv it
returns a pointer to the environment, and I want to play with it (insert
\0 etc, so need to make it safe, then destroy it...

At least that was my plan

Beber wrote:
> Hello,
> 
> I am reading the last commit you did on e_path.c and try to understand why did
> you  do this (snip not interesting) :
> 
> +   char *env_path, *p, *last;
> +   env_path = getenv(env);
> +   env_path = strdup(env_path);
> +   free(env_path);
> 
> Why are you doing a duplication of env_path to .. env_path ? memory is 
> duplicate
> and so lost (for the first env_path allocation) because the same ptr is use 
> and
> so make a mem leak.
> 
> It's not something important but I'm starting reading/understanding e code to
> get a better C code and maybe help you :)
> 
> ++
> Beber
> 
> --
> /* Beber : beber (AT) setibzh (DOT) com
>  * https://guybrush.ath.cx, http://dev.gentoofr.org
>  * irc://irc.ircme.net, irc://irc.freenode.org/#{gentoofr,e.fr}
>  * Using IMP
>  */
> 
> __________________________________________
> Message envoyé à l'aide d'imp.
> Hébergement : http://www.origin-online.net
> 



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r 
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to