summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorMaxim Petrov <mmrmaximuzz@gmail.com>2022-02-15 23:53:47 +0300
committerStephen Hemminger <stephen@networkplumber.org>2022-02-16 12:14:35 -0800
commitcc143bda6bcec20d073f42162f06dde8998551d4 (patch)
tree08c959c5f0696c3aee367ff7d5aeca0ae0bae7f2 /misc
parent90bbf8612bf4dfe06d79ac4d3e04c629a7e64d72 (diff)
downloadiproute2-cc143bda6bcec20d073f42162f06dde8998551d4.tar.gz
lnstat: fix strdup leak in -w argument parsing
'tmp' string is used for safe tokenizing, but it is not required after getting all the widths in -w option. As 'tmp' string is obtained by strdup call, the caller has to deallocate it to avoid memory leak. Signed-off-by: Maxim Petrov <mmrmaximuzz@gmail.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Diffstat (limited to 'misc')
-rw-r--r--misc/lnstat.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/misc/lnstat.c b/misc/lnstat.c
index 98904d45..c3293a8e 100644
--- a/misc/lnstat.c
+++ b/misc/lnstat.c
@@ -331,6 +331,7 @@ int main(int argc, char **argv)
for (i = 0; i < MAX_FIELDS; i++)
fp.params[i].print.width = len;
}
+ free(tmp);
break;
default:
usage(argv[0], 1);