From 287747591e9feafa0d5946e3f7614cec3987e2dc Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Sun, 26 Mar 2023 19:08:08 +0200 Subject: [PATCH] plugins: vbrfix: Fix fd leak & error handling - mp3info returns true for error - fd wasn't closed for non-vbr files Change-Id: I5432025d3384ddf92ed0a478587dcc1715fcf524 --- apps/plugins/vbrfix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/plugins/vbrfix.c b/apps/plugins/vbrfix.c index 88f0a6579e..79fa134499 100644 --- a/apps/plugins/vbrfix.c +++ b/apps/plugins/vbrfix.c @@ -150,7 +150,7 @@ static bool vbr_fix(const char *selected_file) xingupdate(0); rc = rb->mp3info(&entry, selected_file); - if(rc < 0) { + if(rc) { fileerror(rc); return true; } @@ -258,6 +258,8 @@ static bool vbr_fix(const char *selected_file) } else { + rb->close(fd); + /* Not a VBR file */ DEBUGF("Not a VBR file\n"); rb->splash(HZ*2, ID2P(LANG_NOT_A_VBR_FILE));