summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/systems.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2000-04-03 19:56:49 +0000
committerbrian <brian@FreeBSD.org>2000-04-03 19:56:49 +0000
commit56ae0558f5ba0519e94a092249dc6f15954a5e16 (patch)
tree461410c372a15cabb14c57d54f28088915490b5e /usr.sbin/ppp/systems.c
parent08bbcfe72fdb6314543015e5a8831a6ff7dff417 (diff)
downloadFreeBSD-src-56ae0558f5ba0519e94a092249dc6f15954a5e16.zip
FreeBSD-src-56ae0558f5ba0519e94a092249dc6f15954a5e16.tar.gz
Plug two file descriptor leaks
Diffstat (limited to 'usr.sbin/ppp/systems.c')
-rw-r--r--usr.sbin/ppp/systems.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/ppp/systems.c b/usr.sbin/ppp/systems.c
index bea2452..a51491c 100644
--- a/usr.sbin/ppp/systems.c
+++ b/usr.sbin/ppp/systems.c
@@ -349,8 +349,10 @@ ReadSystem(struct bundle *bundle, const char *name, const char *file,
log_Printf(LogCOMMAND, "%s: Including \"%s\"\n", filename, arg);
n = ReadSystem(bundle, name, arg, prompt, cx, how);
log_Printf(LogCOMMAND, "%s: Done include of \"%s\"\n", filename, arg);
- if (!n)
+ if (!n) {
+ fclose(fp);
return 0; /* got it */
+ }
break;
default:
log_Printf(LogWARN, "%s: %s: Invalid command\n", filename, cp);
@@ -364,8 +366,10 @@ ReadSystem(struct bundle *bundle, const char *name, const char *file,
if (strcmp(cp, name) == 0) {
/* We're in business */
- if (how == SYSTEM_EXISTS)
+ if (how == SYSTEM_EXISTS) {
+ fclose(fp);
return 0;
+ }
while ((n = xgets(line, sizeof line, fp))) {
linenum += n;
indent = issep(*line);
OpenPOWER on IntegriCloud