xilinx: zynqmp: Free allocated field for target variable
authorMichal Simek <michal.simek@xilinx.com>
Wed, 28 Jul 2021 10:46:39 +0000 (12:46 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 6 Aug 2021 07:32:02 +0000 (09:32 +0200)
When env_set() is called there is no need to allocate memory for variable
which is already saved that's why free it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
board/xilinx/zynqmp/zynqmp.c

index 38c910f..2cb97f4 100644 (file)
@@ -735,6 +735,7 @@ int board_late_init(void)
                        env_targets ? env_targets : "");
 
        env_set("boot_targets", new_targets);
+       free(new_targets);
 
        reset_reason();