From 0f0ba2c368e72923f5e2343d7e35fb9bf951a686 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Thu, 24 May 2018 14:13:02 +1000 Subject: [PATCH] fixes --- utils/mnetsubunsub/mnetsubunsub.c | 3 +++ utils/mnettoss/mnettoss.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/utils/mnetsubunsub/mnetsubunsub.c b/utils/mnetsubunsub/mnetsubunsub.c index 104633a..20e12c4 100644 --- a/utils/mnetsubunsub/mnetsubunsub.c +++ b/utils/mnetsubunsub/mnetsubunsub.c @@ -229,6 +229,8 @@ void remove_config_file_area(int areaid) { } fgets(buffer, 256, fptr1); } + fclose(fptr1); + fclose(fptr2); unlink(config_file); rename(backup, config_file); } @@ -255,6 +257,7 @@ int main(int argc, char **argv) { fprintf(stderr, "OUTDIR must be defined\n"); return -1; } + config_file = argv[1]; if (strcasecmp(argv[2], "ADD") == 0) { // send add control message diff --git a/utils/mnettoss/mnettoss.c b/utils/mnettoss/mnettoss.c index fb87846..8a54819 100644 --- a/utils/mnettoss/mnettoss.c +++ b/utils/mnettoss/mnettoss.c @@ -299,6 +299,8 @@ void update_config_file_area(int areaid) { } fgets(buffer, 256, fptr1); } + fclose(fptr1); + fclose(fptr2); unlink(config_file); rename(backup, config_file); }