pppd: Fix segfault in update_db_entry()
[ppp.git] / pppd / main.c
index 6e7378be8d7e21ec0d7ed23e17630ec27b6d5e22..6d50d1bac1d998e7ad359a1ec4e35852e3739e1d 100644 (file)
@@ -2043,9 +2043,11 @@ script_setenv(var, value, iskey)
                free(p-1);
                script_env[i] = newstring;
 #ifdef USE_TDB
                free(p-1);
                script_env[i] = newstring;
 #ifdef USE_TDB
-               if (iskey && pppdb != NULL)
-                   add_db_key(newstring);
-               update_db_entry();
+               if (pppdb != NULL) {
+                   if (iskey)
+                       add_db_key(newstring);
+                   update_db_entry();
+               }
 #endif
                return;
            }
 #endif
                return;
            }