[PR #5121] [MERGED] hostnames.c: fix mismatched dealloc (fclose -> pclose) #5369

Closed
opened 2026-05-05 10:37:10 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/5121
Author: @kmk3
Created: 4/26/2022
Status: Merged
Merged: 4/28/2022
Merged by: @reinerh

Base: masterHead: fix-fclose-pclose


📝 Commits (1)

  • 5320ab2 hostnames.c: fix mismatched dealloc (fclose -> pclose)

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 src/fnettrace/hostnames.c (+1 -1)

📄 Description

Partial error log when building firejail-git (afee8603f) with
--enable-fatal-warnings:

hostnames.c: In function ‘retrieve_hostname’:
hostnames.c:53:17: error: ‘fclose’ called on pointer returned from a mismatched allocation function [-Werror=mismatched-dealloc]
   53 |                 fclose(fp);
      |                 ^~~~~~~~~~
hostnames.c:38:20: note: returned from ‘popen’
   38 |         FILE *fp = popen(cmd, "r");
      |                    ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:7: hostnames.o] Error 1

Environment: gcc 11.2.0-4 on Artix Linux.

Added on commit 500a56efd ("more on nettrace", 2022-01-07).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netblue30/firejail/pull/5121 **Author:** [@kmk3](https://github.com/kmk3) **Created:** 4/26/2022 **Status:** ✅ Merged **Merged:** 4/28/2022 **Merged by:** [@reinerh](https://github.com/reinerh) **Base:** `master` ← **Head:** `fix-fclose-pclose` --- ### 📝 Commits (1) - [`5320ab2`](https://github.com/netblue30/firejail/commit/5320ab257f942a0bcc61d22288742480c4470422) hostnames.c: fix mismatched dealloc (fclose -> pclose) ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/fnettrace/hostnames.c` (+1 -1) </details> ### 📄 Description Partial error log when building firejail-git (afee8603f) with --enable-fatal-warnings: hostnames.c: In function ‘retrieve_hostname’: hostnames.c:53:17: error: ‘fclose’ called on pointer returned from a mismatched allocation function [-Werror=mismatched-dealloc] 53 | fclose(fp); | ^~~~~~~~~~ hostnames.c:38:20: note: returned from ‘popen’ 38 | FILE *fp = popen(cmd, "r"); | ^~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[1]: *** [Makefile:7: hostnames.o] Error 1 Environment: gcc 11.2.0-4 on Artix Linux. Added on commit 500a56efd ("more on nettrace", 2022-01-07). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 10:37:11 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#5369
No description provided.