Re: [PATCH 2/7] Add rpm extraction routines (use librpm and libarchive)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looks like you are right. The free seems to be just a leftover from the previous version. libarchive documentation about this is not existing though..

Martin

----- "Panu Matilainen" <pmatilai@xxxxxxxxxxxxxxx> wrote:

> On Wed, 6 Jan 2010, Martin Sivak wrote:
> > ----- "Chris Lumens" <clumens@xxxxxxxxxx> wrote:
> >>> +            if (fdout==NULL){
> >>> +                free((void*)filename);
> >>> +                rc = 33;
> >>> +                break;
> >>> +            }
> >>
> >> I don't think you need to cast this.
> >
> > My GCC thinks I do for some reason. It didn't build without this...
> I 
> > tried. (it was just a warning, but we are converting them to
> errors)
> 
> Well, filename is declared as const char* so passing it to free() will
> 
> certainly complain. The question is: are you *really* supposed to free
> 
> anything coming from archive_entry_pathname()? It's only getting freed
> in 
> an unlikely error path here, so either its leaking memory or the
> free() 
> here is just wrong.
> 
>  	- Panu -
> 
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux