aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libsandbox/libsandbox.c')
-rw-r--r--libsandbox/libsandbox.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libsandbox/libsandbox.c b/libsandbox/libsandbox.c
index 77a2415..e0b291a 100644
--- a/libsandbox/libsandbox.c
+++ b/libsandbox/libsandbox.c
@@ -468,6 +468,7 @@ static bool write_logfile(const char *logfile, const char *func, const char *pat
struct stat log_stat;
int stat_ret;
int logfd;
+ bool ret = false;
stat_ret = lstat(logfile, &log_stat);
/* Do not care about failure */
@@ -523,10 +524,12 @@ static bool write_logfile(const char *logfile, const char *func, const char *pat
}
_SB_WRITE_STR("\n");
- return true;
+ ret = true;
error:
- return false;
+ sb_close(logfd);
+
+ return ret;
}
static void init_context(sbcontext_t *context)