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

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