ソースを参照

mkimage: fit: Free buf directly in fit_extract_data()

If given ptr to free() is NULL, no operation is performed.
Hence we can just free buf directly in fit_extract_data().

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Bin Meng 4 年 前
コミット
0dbd6e3698
1 ファイル変更1 行追加2 行削除
  1. 1 2
      tools/fit_image.c

+ 1 - 2
tools/fit_image.c

@@ -534,8 +534,7 @@ static int fit_extract_data(struct image_tool_params *params, const char *fname)
 err_munmap:
 	munmap(fdt, sbuf.st_size);
 err:
-	if (buf)
-		free(buf);
+	free(buf);
 	close(fd);
 	return ret;
 }