[Pidgin] #8786: small memory leaks

Pidgin trac at pidgin.im
Thu Mar 26 01:14:05 EDT 2009


#8786: small memory leaks
------------------------------------+---------------------------------------
 Reporter:  darkrain42              |           Owner:           
     Type:  patch                   |          Status:  new      
Milestone:  Patches Needing Review  |       Component:  libpurple
  Version:  2.5.5                   |      Resolution:           
 Keywords:                          |   Launchpad_bug:           
------------------------------------+---------------------------------------

Comment(by darkrain42):

 Replying to [comment:2 datallah]:
 > I don't think the (first) patch is actually correct; the list items are
 not actually copied anywhere, so in the cases where the value you're
 adding is a pointer to a static buffer as it would be from any of the
 _(...) gettext functions, the value will end up changing on you. I'm not
 sure what the status of the SILC ciphers and hmacs arrays is in terms of
 expectation of a availability.

 Replying to [comment:2 datallah]:
 > I don't think the (first) patch is actually correct; the list items are
 not actually copied anywhere, so in the cases where the value you're
 adding is a pointer to a static buffer as it would be from any of the
 _(...) gettext functions, the value will end up changing on you. I'm not
 sure what the status of the SILC ciphers and hmacs arrays is in terms of
 expectation of a availability.

 I was under the impression (although I don't know where I got it) that _()
 returns the string in a stable location, as it just returns a pointer to
 string in whatever structure NLS stores them in after they're read in from
 memory.

 The silc arrays are declared statically (and const) in libsilc.


 > Technically these aren't actually leaks as such unless libpurple is
 expected to clean up everything during uninit() - they are just long-
 living data that isn't ever freed (there is always a reference to it).

 Yeah, I realize that; they're minor enough that it's not that big of a
 deal.

-- 
Ticket URL: <http://developer.pidgin.im/ticket/8786#comment:3>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list