From 43d919fe1eb7d8990872239319d7b3259f3a603a Mon Sep 17 00:00:00 2001 From: Qpp0 <93501907+Qpp0@users.noreply.github.com> Date: Mon, 8 Dec 2025 22:05:26 +0800 Subject: [PATCH] fix:typo and release long_opts to avoid small memory leaks --- src/nettrace.c | 2 +- src/trace.c | 2 +- utils/arg_parse.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nettrace.c b/src/nettrace.c index 082b318..1ce521b 100644 --- a/src/nettrace.c +++ b/src/nettrace.c @@ -105,7 +105,7 @@ static void do_parse_args(int argc, char *argv[]) { .lname = "min-latency", .dest = &trace_args->min_latency, .type = OPTION_U32, - .desc = "filter by the minial time to live of the skb in us", + .desc = "filter by the minimal time to live of the skb in us", }, { .lname = "pkt-len", .dest = &trace_args->pkt_len, diff --git a/src/trace.c b/src/trace.c index ff53385..bdb10ca 100644 --- a/src/trace.c +++ b/src/trace.c @@ -756,7 +756,7 @@ int trace_prepare() goto err; } if (!kernel_has_config("DEBUG_INFO_BTF_MODULES")) { - pr_warn("DEBUG_INFO_BTF_MODULES not enabled, some infomation, " + pr_warn("DEBUG_INFO_BTF_MODULES not enabled, some information, " "such as nf_tables, maybe incorrect\n"); } #else diff --git a/utils/arg_parse.c b/utils/arg_parse.c index b0b2235..930fddf 100644 --- a/utils/arg_parse.c +++ b/utils/arg_parse.c @@ -194,6 +194,7 @@ int parse_args(int argc, char *argv[], arg_config_t *config, free(long_opts); return 0; err: + free(long_opts); return -EINVAL; help: printf("%s: %s\n", config->name, config->summary);