trace: remove string duplication
authorDavid Marchand <david.marchand@redhat.com>
Thu, 30 Apr 2020 17:44:48 +0000 (19:44 +0200)
committerDavid Marchand <david.marchand@redhat.com>
Wed, 6 May 2020 13:07:18 +0000 (15:07 +0200)
No need to duplicate an untouched string.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
lib/librte_eal/common/eal_common_trace_utils.c

index 77ea8f7..eed861e 100644 (file)
@@ -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;
 }