← Back to team overview

ubuntu-sdk-bugs team mailing list archive

[Bug 1285056] Re: memory leaks when setting dtstart

 

This bug was fixed in the package qtorganizer5-eds -
0.1.1+14.04.20140228.1-0ubuntu1

---------------
qtorganizer5-eds (0.1.1+14.04.20140228.1-0ubuntu1) trusty; urgency=low

  [ Renato Araujo Oliveira Filho ]
  * Make sure to remove the request from internal list when it get
    destroyed. (LP: #1284587)
  * Implemented support for QOrganizerItemOccurrenceFetchRequest.
  * Fixed memory leaks of ECalComponentDateTime object. (LP: #1285056)
 -- Ubuntu daily release <ps-jenkins@xxxxxxxxxxxxxxxxxxx>   Fri, 28 Feb 2014 23:37:02 +0000

** Changed in: qtorganizer5-eds (Ubuntu)
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
SDK bug tracking, which is subscribed to qtorganizer5-eds in Ubuntu.
https://bugs.launchpad.net/bugs/1285056

Title:
  memory leaks when setting dtstart

Status in “qtorganizer5-eds” package in Ubuntu:
  Fix Released

Bug description:
  engine.cpp is doing something like this to save the event time:

          ECalComponentDateTime *dt = g_new0(ECalComponentDateTime, 1);
          dt->value = g_new0(struct icaltimetype, 1);
          *dt->value = icaltime_from_timet(etr.startDateTime().toTime_t(), etr.isAllDay());
          e_cal_component_set_dtstart(comp, dt);
          e_cal_component_free_datetime(dt);

  e_cal_component_free_datetime() doesn't free the dt pointer. All it
  does is:

          g_free (dt->value);
          g_free ((gchar *) dt->tzid);
          dt->value = NULL;
          dt->tzid = NULL;

  So qtorganizer5-eds is leaking those 'dt' pointers.

  Really, I think neither of the heap operations are necessary here. You
  should be able to do something like:

          struct icaltimetype ict = icaltime_from_timet(etr.startDateTime().toTime_t(), etr.isAllDay());
          ECalComponentDateTime dt;
          dt.tzid = NULL;
          dt.value = &ict;
          e_cal_component_set_dtstart(comp, &dt);
          // all on the stack, so nothing to free

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qtorganizer5-eds/+bug/1285056/+subscriptions


References