Re: [evolution-patches] Patches to fix bug 309079



Attached is the fix for #309079

--Harish

On Fri, 2005-07-01 at 18:22 +0530, Harish Krishnaswamy wrote:
> hi,
> 
>  Oops!!! seems that I jumped the gun over that ...
> 
> The uid (also the string, list and query) often have to outlive 
> the op object and hence must be freed by the callers of the
> operation. Hence the fix is wrong.
> 
> The leak (which occurs when the caller is not expecting the uid)
> should rather be fixed at e_cal_create_object ().
> 
> will send a fresh patch for the same.
> Thanks chen for the heads up.
> 
> -Harish
> 
> 
> 
> On Fri, 2005-07-01 at 09:54 +0530, Harish Krishnaswamy wrote:
> > hi,
> > 
> >  The patch looks good except for the fact that apart from the uid,
> > string, list and query are also being leaked there (whenever they
> > might have been assigned). Plus the styling and casting issues which
> > Not Zed has already pointed out.
> > 
> > Since the patch is just a few lines, I take the liberty to
> > add the changes to the patch and commit them on your behalf.
> > 
> > 
> > 
> > -harish
> > 
> > 
> > 
> > On Thu, 2005-06-30 at 23:41 -0400, Mark G. Adams wrote:
> > > On Fri, 2005-01-07 at 00:11 +0800, Not Zed wrote:
> > > > Minor things - use k&r style braces (it is explained in HACKING), and
> > > > you dont need to cast to GObject anymore for g_object_unref, it takes a
> > > > void * (this isn't a problem; just a suggestion).
> > > 
> > > Noted, thank you for the review.
> > > 
> > > > Can you commit?  If so, fix those and go for it, otherwise someone
> > > > whomever commits it can fix them (no need to send a new patch).
> > > 
> > > No I'm not set up for GNOME CVS access, so I'll need somebody else to do
> > > the commit.
> > > 
> > > //Mark
> > > 
> > > 
> > > _______________________________________________
> > > evolution-patches mailing list
> > > evolution-patches lists ximian com
> > > http://lists.ximian.com/mailman/listinfo/evolution-patches
> > 
> > _______________________________________________
> > evolution-patches mailing list
> > evolution-patches lists ximian com
> > http://lists.ximian.com/mailman/listinfo/evolution-patches
> 
> _______________________________________________
> evolution-patches mailing list
> evolution-patches lists ximian com
> http://lists.ximian.com/mailman/listinfo/evolution-patches
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/ChangeLog,v
retrieving revision 1.470
diff -u -p -r1.470 ChangeLog
--- ChangeLog	23 Jun 2005 05:39:02 -0000	1.470
+++ ChangeLog	2 Jul 2005 04:39:49 -0000
@@ -1,3 +1,9 @@
+2005-07-02  Harish Krishnaswamy  <kharish novell com>
+
+	Fixes #309079
+	* libecal/e-cal.c: (e_cal_create_object): Fix
+	memory leak
+
 2005-06-23  Chenthill Palanisamy  <pchenthill novell com>
 
 	* backends/http/Makefile.am: Removed unnecessary
Index: libecal/e-cal.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/libecal/e-cal.c,v
retrieving revision 1.102
diff -u -p -r1.102 e-cal.c
--- libecal/e-cal.c	6 May 2005 05:19:57 -0000	1.102
+++ libecal/e-cal.c	2 Jul 2005 04:39:50 -0000
@@ -4023,6 +4023,10 @@ e_cal_create_object (ECal *ecal, icalcom
 	status = our_op->status;
 	if (uid)
 		*uid = our_op->uid;
+	else {
+		g_free (our_op->uid);
+		our_op->uid = NULL;
+	}
 	
 	e_calendar_remove_op (ecal, our_op);
 	g_mutex_unlock (our_op->mutex);


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