aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2022-04-26 17:14:20 -0300
committerLibravatar Reiner Herrmann <reiner@reiner-h.de>2022-04-28 16:10:21 +0000
commit92b7148242bcb27e6e413b3a4961d12da67a86f6 (patch)
tree5defb26921c4bfe224e3a5bf85ab2bee0f326ff0 /src
parentMerge branch 'master' of ssh://github.com/netblue30/firejail (diff)
downloadfirejail-92b7148242bcb27e6e413b3a4961d12da67a86f6.tar.gz
firejail-92b7148242bcb27e6e413b3a4961d12da67a86f6.tar.zst
firejail-92b7148242bcb27e6e413b3a4961d12da67a86f6.zip
hostnames.c: fix mismatched dealloc (fclose -> pclose)
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).
Diffstat (limited to 'src')
-rw-r--r--src/fnettrace/hostnames.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fnettrace/hostnames.c b/src/fnettrace/hostnames.c
index dd92070bf..71ce672b5 100644
--- a/src/fnettrace/hostnames.c
+++ b/src/fnettrace/hostnames.c
@@ -50,7 +50,7 @@ char *retrieve_hostname(uint32_t ip) {
50 } 50 }
51 } 51 }
52 } 52 }
53 fclose(fp); 53 pclose(fp);
54 return rv; 54 return rv;
55 } 55 }
56 else 56 else