[pacman-dev] [PATCH] Add remove counterparts to alpm_option_add_* functions

Nagy Gabor ngaba at bibl.u-szeged.hu
Mon Dec 24 07:20:53 EST 2007


> On Dec 23, 2007 6:23 PM, Nagy Gabor <ngaba at bibl.u-szeged.hu> wrote:
> > > Nagy Gabor wrote:
> > > >> Updated patch attached without the memory leaks and adding
> > > >> return of removal success.
> > > >>
> > > >> Cheers,
> > > >> Allan
> > > >>
> > > >
> > > > Is newcachedir freed?;-)
> > > > Bye
> > > >
> > > >
> > > No... but it wasn't in alpm_option_add_cachedir() either and I was
> > > trying for coding style consistency. :)  Both are fixed in
> > > attached patch.
> > No. You mustn't free it in add_cachedir, because alpm_list_add just
> > adds a POINTER to the (handle->cachedirs) list. (So you can always
> > think alpm_list as a list of pointers.)
> 
> Ok, enough of this junk. Sorry to rain down on the holiday spirit, but
> can we please not be cryptic on this mailing list with cute little
> remarks and smiley faces?
> 
> Something like this would have saved us all 5 minutes of our time.
> "I noticed that newcachedir was not freed in remove_cachedir- as far
> as I can tell, it needs to be freed because we aren't adding it to a
> list and it isn't needed outside of the function."
> 
> -Dan
> 

1. If you refer to "Is newcachedir freed?;-)", then you should
have answered to my previous mail, because we had an _other_ bug here.

2. These "junks" were addressed to Allen, who fortunately understood
them. He is new to the code (as he said), and I thought he need other
information than you/us (alpm_list_t explanation). But if this is
forbidden here, next time I will write a direct e-mail to him or be
silent.

Merry Christmas!




More information about the pacman-dev mailing list