[U-Boot] [PATCH] fw_env: Fix double free

Björn Stenberg bjorn at haxx.se
Wed Apr 17 14:56:54 UTC 2019


addr0 is being freed twice, leading to segmentation fault

Signed-off-by: Björn Stenberg <bjorn at haxx.se>
---
 tools/env/fw_env.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index a5d75958e1..1ed0f7e9cb 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -1566,7 +1566,7 @@ int fw_env_open(struct env_opts *opts)
  free(addr0);

  if (addr1)
- free(addr0);
+ free(addr1);

  return ret;
 }
-- 
2.20.1


More information about the U-Boot mailing list