diff options
author | maximilian attems <max@stro.at> | 2010-11-14 11:39:38 +0100 |
---|---|---|
committer | maximilian attems <max@stro.at> | 2010-11-14 11:45:38 +0100 |
commit | 8a0606cf7aabce7533e50edf65b5156fbb7d0907 (patch) | |
tree | 544b8bf09c320729aa584cfa490bbaadf5fe7d3f | |
parent | 264dda888400496630232abf7d6d945f97c72ed7 (diff) | |
download | klibc-8a0606cf7aabce7533e50edf65b5156fbb7d0907.tar.gz |
[klibc] nfsmounf: start_dummy_portmap() close fd on error path
fix ressource leakage.
Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r-- | usr/kinit/nfsmount/dummypmap.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/usr/kinit/nfsmount/dummypmap.c b/usr/kinit/nfsmount/dummypmap.c index 43abe37b75bb1..e5ebef972d75d 100644 --- a/usr/kinit/nfsmount/dummypmap.c +++ b/usr/kinit/nfsmount/dummypmap.c @@ -249,6 +249,7 @@ pid_t start_dummy_portmap(const char *file) if (errno == EINVAL || errno == EADDRINUSE) return 0; /* Assume not needed */ else { + fclose(portmap_filep); fprintf(stderr, "%s: portmap spoofing failed\n", progname); return -1; @@ -257,6 +258,7 @@ pid_t start_dummy_portmap(const char *file) spoof_portmap = fork(); if (spoof_portmap == -1) { + fclose(portmap_filep); fprintf(stderr, "%s: cannot fork\n", progname); return -1; } else if (spoof_portmap == 0) { |