From 70f48f1f44bf419aac77de8664816a17122c8b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Tue, 5 Jan 2021 14:47:49 +0100 Subject: Add wrapper function for free and strdup Reduces code in callers and helps avoiding memory leaks. --- htop.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'htop.c') 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': { -- cgit v1.2.3