diff options
author | Daiki Ueno <ueno@gnu.org> | 2021-03-15 10:47:50 +0100 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2021-03-15 10:48:32 +0100 |
commit | e4950b12282fb33847270169d470d0d35c966cf7 (patch) | |
tree | a6622740ec1389a3e801652c738a7b099f2bc6a3 /src | |
parent | c95312c5831be5418dc02a86d72bcd1eafd4c145 (diff) | |
download | gnutls-e4950b12282fb33847270169d470d0d35c966cf7.tar.gz |
srptool: avoid FILE pointer leak on error
Signed-off-by: Daiki Ueno <ueno@gnu.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/srptool.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/srptool.c b/src/srptool.c index a9715e6a37..9326ac4dad 100644 --- a/src/srptool.c +++ b/src/srptool.c @@ -310,14 +310,14 @@ verify_passwd(const char *conffile, const char *tpasswd, } while (p != NULL && atoi(p) != iindex); + fclose(fp); + if (p == NULL) { fprintf(stderr, "Cannot find entry in %s\n", conffile); return -1; } line[sizeof(line) - 1] = 0; - fclose(fp); - if (read_conf_values(&g, &n, line) < 0) { fprintf(stderr, "Cannot parse conf file '%s'\n", conffile); return -1; |