
13 Jan
2020
13 Jan
'20
9:24 a.m.
Hi,
From: Anatolij Gustschin agust@denx.de Sent: dimanche 12 janvier 2020 20:51
Hi Patrick,
On Fri, 10 Jan 2020 08:50:31 +0100 Patrick Delaunay patrick.delaunay@st.com wrote: ...
diff --git a/tools/fdtgrep.c b/tools/fdtgrep.c index 8f44f599c1..bcf06b871d 100644 --- a/tools/fdtgrep.c +++ b/tools/fdtgrep.c @@ -823,8 +823,10 @@ static int do_fdtgrep(struct display_info *disp, const
char *filename)
} if (count <= max_regions) break;
- }
- if (count > max_regions) { free(region);
This change moved free(region) out of the loop. If you do so, then please also change malloc() in the loop to realloc():
region = realloc(region, count * sizeof(struct fdt_region));
Yes, I will push V2 with realloc to avoid the memory leak that I introduced..
Thanks for review
-- Anatolij
Patrick