X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fauth.c;h=ec137109141fa6428eed257862326aaf6048afff;hb=57edb1a0ebf3e25d824b22c75d1d95e0f378f74a;hp=7457eda227bf19c2d09b79dd4e0b031da6bc1bf9;hpb=d34159f417620eb7c481bf53f29fe04c86ccd223;p=ppp.git diff --git a/pppd/auth.c b/pppd/auth.c index 7457eda..ec13710 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -119,7 +119,6 @@ #include "pathnames.h" #include "session.h" -static const char rcsid[] = RCSID; /* Bits in scan_authfile return value */ #define NONWILD_SERVER 1 @@ -430,6 +429,7 @@ setupapfile(argv) euid = geteuid(); if (seteuid(getuid()) == -1) { option_error("unable to reset uid before opening %s: %m", fname); + free(fname); return 0; } ufile = fopen(fname, "r"); @@ -437,6 +437,7 @@ setupapfile(argv) fatal("unable to regain privileges: %m"); if (ufile == NULL) { option_error("unable to open user login data file %s", fname); + free(fname); return 0; } check_access(ufile, fname); @@ -447,6 +448,7 @@ setupapfile(argv) || fgets(p, MAXSECRETLEN - 1, ufile) == NULL) { fclose(ufile); option_error("unable to read user login data file %s", fname); + free(fname); return 0; } fclose(ufile); @@ -468,6 +470,7 @@ setupapfile(argv) explicit_passwd = 1; } + free(fname); return (1); }