Blame SOURCES/0018-Try-even-harder-to-convince-coverity-that-get_file-i.patch

36520b
From 576b89de7d1a49d64efab9d494eeea5a296bdccd Mon Sep 17 00:00:00 2001
36520b
From: Peter Jones <pjones@redhat.com>
36520b
Date: Thu, 21 Jun 2018 12:23:20 -0400
36520b
Subject: [PATCH 18/39] Try even harder to convince coverity that get_file
36520b
 isn't leaking memory...
36520b
36520b
Signed-off-by: Peter Jones <pjones@redhat.com>
36520b
---
36520b
 src/util.h | 7 +++++++
36520b
 1 file changed, 7 insertions(+)
36520b
36520b
diff --git a/src/util.h b/src/util.h
36520b
index ef85a4c277e..441ced84fcf 100644
36520b
--- a/src/util.h
36520b
+++ b/src/util.h
36520b
@@ -332,6 +332,13 @@ get_file(uint8_t **result, const char * const fmt, ...)
36520b
         errno = error;
36520b
 
36520b
         if (rc < 0 || bufsize < 1) {
36520b
+                /*
36520b
+                 * I don't think this can happen, but I can't convince
36520b
+                 * cov-scan
36520b
+                 */
36520b
+                if (buf)
36520b
+                        free(buf);
36520b
+                *result = NULL;
36520b
                 efi_error("could not read file \"%s\"", path);
36520b
                 return -1;
36520b
         }
36520b
-- 
36520b
2.17.1
36520b