lib/tst_memutils.c: Fix resource leak
PATCH v2 1/1 lib/tst_memutils.c: Fix resource leak
File descriptor was not closed properly
before return.
Signed-off-by Bogdan Lezhepekov <[email protected]>
--- lib/tst_memutils.c | 3 +++ 1 file changed, 3 insertions(+)
lib/tst_memutils.c +3 -0
@@ -122,7 +122,10 @@ static int write_score(const char *path, int score)return 1 ;if (fprintf (f,"%d" , score) <=0 ) + { +fclose (f);return 1 ; + }if (fclose (f))return 1 ;
Signature · 5 lines
2.35.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp