diff --git a/src/debugfile.c b/src/debugfile.c index 334b4e52d..9d2681112 100644 --- a/src/debugfile.c +++ b/src/debugfile.c @@ -32,6 +32,8 @@ int debugfile_init (debugfile_ctx_t *debugfile_ctx, const uint debug_mode, const void debugfile_destroy (debugfile_ctx_t *debugfile_ctx) { + if (debugfile_ctx->fp == NULL) return; + fclose (debugfile_ctx->fp); }