Subject: pkg/19460: Package audio/easytag leaks filehandles
To: None <gnats-bugs@gnats.netbsd.org>
From: None <pino@dohd.org>
List: netbsd-bugs
Date: 12/19/2002 15:26:53
>Number:         19460
>Category:       pkg
>Synopsis:       Package audio/easytag leaks filehandles
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 19 06:27:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 1.6K
>Organization:
	
>Environment:
	
	
System: NetBSD lucifer.ipv6.stack.nl 1.6K NetBSD 1.6K (GENERIC) #1: Sat Dec 14 19:29:54 CET 2002 martijnb@lucifer.ipv6.stack.nl:/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
	EasyTAG doesn't nicely close files without an ID3v2 tag. This means
	that it'll eventually find itself unable to open new files.
>How-To-Repeat:
	Start EasyTAG, and browse through a collection of MP3 files without 
	ID3v2 tag (but with only an ID3v1 tag). After a while, it will start
	to complain.

>Fix:
	Apply the following patch:

--- src/id3_tag.c.orig	Sat Oct  5 23:32:43 2002
+++ src/id3_tag.c	Thu Dec 19 15:12:01 2002
@@ -808,13 +808,16 @@
     {
         fseek(file,0,SEEK_SET);
         if (fread(tmp,1,4, file) != 4)
+	{
+	    fclose(file);
             return -1;
-
+	}
+        fclose(file);
         if (tmp[0] == 'I' && tmp[1] == 'D' && tmp[2] == '3' && tmp[3] < 0xFF)
         {
-            fclose(file);
             return (gint)tmp[3];
-        }else
+        }
+	else
         {
             return -1;
         }
>Release-Note:
>Audit-Trail:
>Unformatted: