aboutsummaryrefslogtreecommitdiffstats
path: root/gtp/gtp.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtp/gtp.c')
-rw-r--r--gtp/gtp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gtp/gtp.c b/gtp/gtp.c
index a3772ff..be53b5e 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -665,7 +665,7 @@ static void log_restart(struct gsn_t *gsn)
if (rc != 1) {
LOGP(DLGTP, LOGL_ERROR,
"fscanf failed to read counter value\n");
- return;
+ goto close_file;
}
if (fclose(f)) {
LOGP(DLGTP, LOGL_ERROR,
@@ -685,6 +685,7 @@ static void log_restart(struct gsn_t *gsn)
umask(i);
fprintf(f, "%d\n", gsn->restart_counter);
+close_file:
if (fclose(f)) {
LOGP(DLGTP, LOGL_ERROR,
"fclose failed: Error = %s\n", strerror(errno));