]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/main.c
pppd: Don't try to free(NULL - 1)
[ppp.git] / pppd / main.c
index f1986ed68d0b7e4d00f81b956e2abbb263b79d7a..e09b6ffcce32bd06389d91da6276f24c1e009007 100644 (file)
@@ -257,7 +257,6 @@ static void cleanup_db __P((void));
 static void handle_events __P((void));
 void print_link_stats __P((void));
 
-extern char    *ttyname __P((int));
 extern char    *getlogin __P((void));
 int main __P((int, char *[]));
 
@@ -1752,7 +1751,7 @@ update_script_environment()
                script_env[i] = newstring;
            else
                add_script_env(i, newstring);
-       } else {
+       } else if (p != NULL) {
            remove_script_env(i);
        }
     }