summaryrefslogtreecommitdiffstats
path: root/htop.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-01-05 14:47:49 +0100
committerBenBE <BenBE@geshi.org>2021-01-11 20:12:34 +0100
commit70f48f1f44bf419aac77de8664816a17122c8b29 (patch)
tree1959d394f65bf68a942e9ef4018f22a534eecfc3 /htop.c
parent958112c5a396815da7a731f406dbfd27bf713572 (diff)
Add wrapper function for free and strdup
Reduces code in callers and helps avoiding memory leaks.
Diffstat (limited to 'htop.c')
-rw-r--r--htop.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/htop.c b/htop.c
index a8935f40..e59c0282 100644
--- a/htop.c
+++ b/htop.c
@@ -204,9 +204,7 @@ static CommandLineSettings parseArguments(int argc, char** argv) {
}
case 'F': {
assert(optarg);
- free(flags.commFilter);
- flags.commFilter = xStrdup(optarg);
-
+ free_and_xStrdup(&flags.commFilter, optarg);
break;
}
case 'H': {

© 2014-2024 Faster IT GmbH | imprint | privacy policy