]> git.baikalelectronics.ru Git - uboot.git/commit
fdtgrep: Separate out checking of two allocations
authorSimon Glass <sjg@chromium.org>
Tue, 12 Jun 2018 06:04:59 +0000 (00:04 -0600)
committerTom Rini <trini@konsulko.com>
Tue, 19 Jun 2018 11:31:44 +0000 (07:31 -0400)
commit9ee842c4fe279172c8623de937ced89eb82a7b43
tree231962584a8b572586605b81e42c3f9fa0ebc4ef
parent4b11491001d244fa5cf2a0e3149e5fe4868ddd79
fdtgrep: Separate out checking of two allocations

The current code might succeed on the first allocation and fail on the
second. Separate the checks to avoid this problem.

Of course, free() will never fail and the chances that (when allocating
two small areas) one will succeed and one will fail are just as remote.
But this keeps coverity happy.

Reported-by: Coverity (CID: 131226)
Signed-off-by: Simon Glass <sjg@chromium.org>
tools/fdtgrep.c