MESSAGE
DATE | 2004-04-22 |
FROM | Billy
|
SUBJECT | Re: [hangout] [billy@mail.dadadada.net: cdparanoia: minor memory leak]
|
On Thu, Apr 22, 2004 at 05:19:19AM -0400, Ruben Safir Secretary NYLXS wrote: > > Last night as I was going to sleep I was thinking of doing just this > and sending it to the CVS server.
You don't think you can do a CVS commit unless you're the maintainer.
> On Wed, Apr 21, 2004 at 02:35:21PM -0400, Billy wrote: > > > > This 'minor' severity bug may not end up > > on the Debian package website. > > > > ----- Forwarded message from Billy ----- > > > > From: Billy > > To: Debian Bug Tracking System > > Subject: cdparanoia: minor memory leak > > Envelope-to: billy-at-mail.dadadada.net > > Delivery-date: Wed, 21 Apr 2004 14:26:41 -0400 > > X-Spam-Status: No, hits=-3.2 required=5.0 tests=UNIFIED_PATCH,NO_MX_FOR_FROM version=2.20 > > X-Spam-Level: > > > > Package: cdparanoia > > Version: 3a9.8-6 > > Severity: minor > > Tags: patch > > > > > > There's a leak in cdda_find_a_cdrom(). > > A buffer is allocated via copystring() for each attempt > > at filling the '?' wildcard in the cdrom_devices list. > > This buffer is never freed. Also, the buffer is > > allocated once per pattern attempt, which isn't really > > necessary, so I changed that while I was in there. > > I also changed the magic numbers 48 and 97 to > > '0' and 'a' for clarity's sake. > > > > diff -ru cdparanoia-3a9.8/interface/scan_devices.c cdparanoia/interface/scan_devices.c > > --- cdparanoia-3a9.8/interface/scan_devices.c Wed Apr 21 11:41:25 2004 > > +++ cdparanoia/interface/scan_devices.c Wed Apr 21 11:51:49 2004 > > -at--at- -65,21 +65,16 -at--at- > > char *pos; > > if((pos=strchr(cdrom_devices[i],'?'))){ > > int j; > > - /* try first eight of each device */ > > - for(j=0;j<4;j++){ > > - char *buffer=copystring(cdrom_devices[i]); > > - > > + /* try 0->4 and a->d for each device */ > > + char *buffer=copystring(cdrom_devices[i]); > > + for(j=0;j<8;j++){ > > /* number, then letter */ > > - > > - buffer[pos-(cdrom_devices[i])]=j+48; > > - if((d=cdda_identify(buffer,messagedest,messages))) > > - return(d); > > - idmessage(messagedest,messages,"",NULL); > > - buffer[pos-(cdrom_devices[i])]=j+97; > > + buffer[pos-(cdrom_devices[i])]=(j>>1)+(j&1)?'a':'0';
Actually, this line should be:
+ buffer[pos-(cdrom_devices[i])]=(j>>1)+((j&1)?'a':'0');
I corrected it and resubmitted.
> > if((d=cdda_identify(buffer,messagedest,messages))) > > return(d); > > idmessage(messagedest,messages,"",NULL); > > } > > + free(buffer); > > }else{ > > /* Name. Go for it. */ > > if((d=cdda_identify(cdrom_devices[i],messagedest,messages))) ____________________________ NYLXS: New Yorker Free Software Users Scene Fair Use - because it's either fair use or useless.... NYLXS is a trademark of NYLXS, Inc
|
|