[PATCH 3/4] Fix gcc-11 compilation warning on makedumpfile.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Without the patch, the following gcc-11 compilation warning is emitted
for makedumpfile.c:

In function 'flattened_format_get_osrelease',
    inlined from 'check_flattened_format' at makedumpfile.c:236:3:
makedumpfile.c:392:9: warning: 'fclose' called on pointer returned from a mismatched allocation function [-Wmismatched-dealloc]
  392 |         fclose(pipe);
      |         ^~~~~~~~~~~~
makedumpfile.c: In function 'check_flattened_format':
makedumpfile.c:380:21: note: returned from 'popen'
  380 |         if ((pipe = popen(buf, "r")) == NULL)
      |                     ^~~~~~~~~~~~~~~

Signed-off-by: Kazuhito Hagio <k-hagio-ab@xxxxxxx>
---
 makedumpfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/makedumpfile.c b/makedumpfile.c
index ebf24f5..26d12b6 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -389,5 +389,5 @@ flattened_format_get_osrelease(char *file)
 		}
 	}
 
-	fclose(pipe);
+	pclose(pipe);
 }
-- 
2.31.1

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/crash-utility
Contribution Guidelines: https://github.com/crash-utility/crash/wiki




[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux