mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
capture-writer: finalize if allocate failed
This commit is contained in:
@ -433,8 +433,12 @@ sp_capture_writer_new_from_fd (int fd,
|
||||
nowstr = g_time_val_to_iso8601 (&tv);
|
||||
|
||||
header = sp_capture_writer_allocate (self, &header_len);
|
||||
if (!header)
|
||||
return NULL;
|
||||
|
||||
if (header == NULL)
|
||||
{
|
||||
sp_capture_writer_finalize (self);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
header->magic = SP_CAPTURE_MAGIC;
|
||||
header->version = 1;
|
||||
|
||||
Reference in New Issue
Block a user