From: James Carlson <carlsonj@workingcode.com>
To: linux-ppp@vger.kernel.org
Subject: Re: a question about script_setenv in main.c for pppd code
Date: Tue, 15 Jul 2008 15:28:58 +0000 [thread overview]
Message-ID: <18556.49722.631932.374787@gargle.gargle.HOWL> (raw)
In-Reply-To: <200807151722144210868@gmail.com>
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@workingcode.com>
prev parent reply other threads:[~2008-07-15 15:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-15 9:22 a question about script_setenv in main.c for pppd code c4linux
2008-07-15 15:28 ` James Carlson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=18556.49722.631932.374787@gargle.gargle.HOWL \
--to=carlsonj@workingcode.com \
--cc=linux-ppp@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox