From: David Marchand Date: Thu, 30 Apr 2020 17:44:48 +0000 (+0200) Subject: trace: remove string duplication X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3df4282917fc5b34a99b5da5d2e35df9f269b7ca;p=dpdk.git trace: remove string duplication No need to duplicate an untouched string. Signed-off-by: David Marchand Acked-by: Sunil Kumar Kori --- diff --git a/lib/librte_eal/common/eal_common_trace_utils.c b/lib/librte_eal/common/eal_common_trace_utils.c index 77ea8f78e1..eed861e228 100644 --- a/lib/librte_eal/common/eal_common_trace_utils.c +++ b/lib/librte_eal/common/eal_common_trace_utils.c @@ -173,19 +173,11 @@ eal_trace_args_free(void) int trace_args_apply(const char *arg) { - char *str; - - str = strdup(arg); - if (str == NULL) - return -1; - - if (rte_trace_regexp(str, true) < 0) { - trace_err("cannot enable trace for %s", str); - free(str); + if (rte_trace_regexp(arg, true) < 0) { + trace_err("cannot enable trace for %s", arg); return -1; } - free(str); return 0; }