cmd: nfsdown: fix memory corruption with global memory free
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 2 Aug 2017 10:04:23 +0000 (19:04 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 20 Oct 2020 01:35:22 +0000 (10:35 +0900)
commit49a38c5d2ed3ecd056c0f947c7a633d858c0ca43
tree057024a753952587b77785b34fad3017a272f6ab
parent5286f93ac0359225818875ac2bcecceee8d6206c
cmd: nfsdown: fix memory corruption with global memory free

Calling free() for result of getenv() causes memory corruption
because getenv() returns global memory area. Fix the corruption
with copying result of getenv() because parsing it with strtok()
changes the string.

Change-Id: I21374e7d622b603de9f8d3d036561d00b1e26c23
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
cmd/nfsdown.c