[sysprof] libsysprof-capture: be more defensive
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] libsysprof-capture: be more defensive
- Date: Wed, 5 Jun 2019 23:40:21 +0000 (UTC)
commit 400e5b81bc65112125c252d3b6cd0b4f9d7bb87b
Author: Christian Hergert <chergert redhat com>
Date: Wed Jun 5 15:11:04 2019 -0700
libsysprof-capture: be more defensive
src/libsysprof-capture/sysprof-capture-writer.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/libsysprof-capture/sysprof-capture-writer.c b/src/libsysprof-capture/sysprof-capture-writer.c
index 6c6c01a..477465a 100644
--- a/src/libsysprof-capture/sysprof-capture-writer.c
+++ b/src/libsysprof-capture/sysprof-capture-writer.c
@@ -165,7 +165,13 @@ sysprof_capture_writer_finalize (SysprofCaptureWriter *self)
if (self != NULL)
{
sysprof_capture_writer_flush (self);
- close (self->fd);
+
+ if (self->fd != -1)
+ {
+ close (self->fd);
+ self->fd = -1;
+ }
+
g_free (self->buf);
g_free (self);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]