]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/main.c
pppd: Check tdb pointer before closing
[ppp.git] / pppd / main.c
index 41be5328d4b8d7b7af89935cc66f093a5b932da9..1b3f1e54bdd3250cb41fb986b89b3aaff355128e 100644 (file)
@@ -1574,7 +1574,8 @@ safe_fork(int infd, int outfd, int errfd)
        /* Executing in the child */
        sys_close();
 #ifdef USE_TDB
-       tdb_close(pppdb);
+       if (pppdb != NULL)
+               tdb_close(pppdb);
 #endif
 
        /* make sure infd, outfd and errfd won't get tromped on below */