[sysprof] capture-writer: finalize if allocate failed
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] capture-writer: finalize if allocate failed
- Date: Mon, 21 Nov 2016 04:26:47 +0000 (UTC)
commit f11aaa189f0897f7edb3a44b9b22349e258cd504
Author: Christian Hergert <chergert redhat com>
Date: Sun Nov 20 20:26:34 2016 -0800
capture-writer: finalize if allocate failed
lib/sp-capture-writer.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/lib/sp-capture-writer.c b/lib/sp-capture-writer.c
index b81f1e2..8e2e082 100644
--- a/lib/sp-capture-writer.c
+++ b/lib/sp-capture-writer.c
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]