[Pidgin] #1344: fix for some build warnings

Pidgin trac at pidgin.im
Tue May 29 15:12:29 EDT 2007


#1344: fix for some build warnings
----------------------------+-----------------------------------------------
  Reporter:  o_sukhodolsky  |       Owner:  rlaager 
      Type:  patch          |      Status:  assigned
  Priority:  minor          |   Milestone:  2.0.2   
 Component:  pidgin (gtk)   |     Version:  2.0.1   
Resolution:                 |    Keywords:          
   Pending:  0              |  
----------------------------+-----------------------------------------------
Comment (by o_sukhodolsky):

 Replying to [comment:9 rlaager]:
 > Replying to [comment:5 o_sukhodolsky]:
 > > well, I think that g_malloc() can return NULL in the same case as
 malloc() though it is not documented :(  Anyway it looks like you do not
 care about this case, so I'm ok to not do this check.
 >
 > g_malloc() only returns NULL if you pass a length of 0. This is
 impossible in this case, as we're adding two to the data length anyway.
 (Well, if that's -2 or something, I suppose, but that really shouldn't be
 happening.) malloc() returns NULL when it can't allocate memory. If you
 ask g_malloc() for memory, it asks malloc(). If malloc() returns NULL,
 g_malloc() calls abort() and the application terminates.

 Ok, I've removed this check.

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


More information about the Tracker mailing list