From 071f14697f536e83f45bd0b83d73d722435c213b Mon Sep 17 00:00:00 2001 From: dkulikov Date: Wed, 25 Sep 2024 08:57:29 +0000 Subject: [PATCH] 0027410: Data Exchange, Iges Import - Possible resource leak when parsing an invalid file fclose() call is added before early return statement in igesread() function. --- src/IGESFile/igesread.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/IGESFile/igesread.c b/src/IGESFile/igesread.c index f923514982..8867f07201 100644 --- a/src/IGESFile/igesread.c +++ b/src/IGESFile/igesread.c @@ -78,8 +78,12 @@ int igesread (char* nomfic, int lesect[6], int modefnes) str[0] = sects[i0]; IGESFile_Check2 (0,"XSTEP_18",numl,str); /* //gka 15 Sep 98: str instead of sects[i0]); */ } - - if (i0 == 0) return -1; + + if (i0 == 0) + { + fclose(lefic); + return -1; + } lesect[i0] ++; continue; }