Re: [evolution-patches] Bug 45210 - LDAP PostalAddress compliance patch for evolution-data-server, contacts



Looks good.  do you have CVS access?  If so, go ahead and commit.

Chris

On Mon, 2004-05-03 at 17:10 -0500, Edward Rudd wrote:
> On Mon, 2004-05-03 at 16:17, Chris Toshok wrote:
> > > > 
> > > Well, from tacking down what e_contact_get does, returns a gpointer
> > > retrieved from g_object_get, and not a copy of the structure.
> > 
> > e_contact_get on string fields (like the address labels) returns
> > allocated space for the string.  Trust me, I wrote the code.
> > e_contact_get_const is what you want to use if you don't want the copy,
> > but in this case you do want the copy - just not the extra g_strdup.
> > 
> OK, then the functions email_ber, homephone_ber, businessphone_ber, and
> the like all need to be updated as they use e_contact_get instead of
> e_contact_get_const and then g_strdup the results into the berval *.
> 
> I've attached an updated patch, that removed the temp char *, and also
> uses e-contact_get_const in the address_compare function.
> 
> > >  And all
> > > the other *_ber functions for complex type handling never touch the data
> > > retrieved from e_contact_get and type them as const char *, and they
> > > always make a copy which they place in the (berval*)->bv-val.  Therefore
> > > no leak is happening at all as I am putting the fixed temp var directly
> > > into the berval stucture. 
> > 
> > No, therefore the other *_ber functions (and lots of other functions in
> > there) are leaking :)  look at email_compare.  it uses (correctly)
> > e_contact_get_const.
> > 
> > Chris
> -- 
> Edward Rudd <eddie omegaware com>
> Website http://www.outoforder.cc/



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