Re: a question about script_setenv in main.c for pppd code

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

 



c4linux writes:
>     /* check if this variable is already set */
>     if (script_env != 0) {
> 	for (i = 0; (p = script_env[i]) != 0; ++i) {
> 	    if (strncmp(p, var, varl) == 0 && p[varl] == '=') {
> #ifdef USE_TDB
> 		if (p[-1] && pppdb != NULL)
> 		    delete_db_key(p);
> #endif
> 		free(p-1);
>   ......
>   ......
> 
> why not free(p) but free(p-1) ?

It's because of these two lines in that same function:

    *newstring++ = iskey;
[...]
    script_env[i] = newstring;

-- 
James Carlson         42.703N 71.076W         <carlsonj@xxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Audio Users]     [Linux for Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Fedora Users]

  Powered by Linux