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

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