efi_loader: endless loop in add_strings_package()

Avoid an endless loop in add_strings_package().

Suggested-by: Takahiro Akashi <takahiro.akashi@linaro.org>
Reported-by: Coverity (CID 185833)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
Heinrich Schuchardt 2019-03-19 12:30:27 +01:00
parent 306b16718e
commit bd3b7478d1

View file

@ -227,9 +227,8 @@ out:
error: error:
if (stbl) { if (stbl) {
free(stbl->language); free(stbl->language);
if (idx > 0) while (idx > 0)
while (--idx >= 0) free(stbl->strings[--idx].string);
free(stbl->strings[idx].string);
free(stbl->strings); free(stbl->strings);
} }
free(stbl); free(stbl);