diff --git a/Source/KSCrash/Source/KSCrash/Recording/BSG_KSCrashState.c b/Source/KSCrash/Source/KSCrash/Recording/BSG_KSCrashState.c index a24ba3b34..9654f54ad 100644 --- a/Source/KSCrash/Source/KSCrash/Recording/BSG_KSCrashState.c +++ b/Source/KSCrash/Source/KSCrash/Recording/BSG_KSCrashState.c @@ -266,11 +266,11 @@ bool bsg_kscrashstate_i_saveState(const BSG_KSCrash_State *const state, goto done; } result = bsg_ksjsonendEncode(&JSONContext); - -done: if (!bsg_ksfuflushWriteBuffer(fd)) { BSG_KSLOG_ERROR("Failed to flush write buffer"); } + +done: close(fd); if (result != BSG_KSJSON_OK) {