UBI: fix leak in ubi_scan_erase_peb

Coverity (1769) found the following problem: if the erase counter
overflow check triggers, ec_hdr is leaked.

Moving the allocation after the overflow check should take care of it.

Signed-off-by: Florin Malita <fmalita@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
This commit is contained in:
Florin Malita 2007-07-19 15:22:41 -04:00 committed by Artem Bityutskiy
commit dcec4c3bdc