mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-10 07:00:53 +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)
|
if (self != NULL)
|
||||||
{
|
{
|
||||||
sysprof_capture_writer_flush (self);
|
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->buf);
|
||||||
g_free (self);
|
g_free (self);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user