Blame SOURCES/0012-Fix-gcc-11-compiler-warning-on-makedumpfile.c.patch

acf3ec
From 9bb8a48d9424fc00ccd073125cdee9613b389cc6 Mon Sep 17 00:00:00 2001
acf3ec
From: Kazuhito Hagio <k-hagio-ab@nec.com>
acf3ec
Date: Fri, 22 Jul 2022 13:44:50 +0900
acf3ec
Subject: [PATCH 12/28] Fix gcc-11 compiler warning on makedumpfile.c
acf3ec
acf3ec
Without the patch, the following gcc-11 compiler warning is emitted for
acf3ec
makedumpfile.c:
acf3ec
acf3ec
In function 'flattened_format_get_osrelease',
acf3ec
    inlined from 'check_flattened_format' at makedumpfile.c:236:3:
acf3ec
makedumpfile.c:392:9: warning: 'fclose' called on pointer returned from a mismatched allocation function [-Wmismatched-dealloc]
acf3ec
  392 |         fclose(pipe);
acf3ec
      |         ^~~~~~~~~~~~
acf3ec
makedumpfile.c: In function 'check_flattened_format':
acf3ec
makedumpfile.c:380:21: note: returned from 'popen'
acf3ec
  380 |         if ((pipe = popen(buf, "r")) == NULL)
acf3ec
      |                     ^~~~~~~~~~~~~~~
acf3ec
acf3ec
Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
acf3ec
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
acf3ec
---
acf3ec
 makedumpfile.c | 2 +-
acf3ec
 1 file changed, 1 insertion(+), 1 deletion(-)
acf3ec
acf3ec
diff --git a/makedumpfile.c b/makedumpfile.c
acf3ec
index ebf24f56da2c..26d12b638ecd 100644
acf3ec
--- a/makedumpfile.c
acf3ec
+++ b/makedumpfile.c
acf3ec
@@ -389,5 +389,5 @@ flattened_format_get_osrelease(char *file)
acf3ec
 		}
acf3ec
 	}
acf3ec
 
acf3ec
-	fclose(pipe);
acf3ec
+	pclose(pipe);
acf3ec
 }
acf3ec
-- 
acf3ec
2.37.1
acf3ec