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

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