mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-capture: be more defensive
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user