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

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