[evolution-ews] Fix memory leak of error in ews_response_cb()



commit 96cac9ca2bf1f8e380c1c99f5171355ea7817548
Author: David Woodhouse <David Woodhouse intel com>
Date:   Sun Aug 14 00:40:23 2011 +0100

    Fix memory leak of error in ews_response_cb()
    
    ==3576== 3,844 (944 direct, 2,900 indirect) bytes in 59 blocks are definitely lost in los
    s record 24,613 of 25,597
    ==3576==    at 0x4A0649D: malloc (vg_replace_malloc.c:236)
    ==3576==    by 0x3D33049600: g_malloc (gmem.c:164)
    ==3576==    by 0x3D3305E476: g_slice_alloc (gslice.c:842)
    ==3576==    by 0x3D3302F1C1: g_error_new_valist (gerror.c:56)
    ==3576==    by 0x3D3302F50C: g_set_error (gerror.c:220)
    ==3576==    by 0x19923A82: ews_get_response_status (e-ews-connection.c:248)
    ==3576==    by 0x19923CAE: ews_response_cb (e-ews-connection.c:441)
    ==3576==    by 0x3D48043069: process_queue_item (soup-session-async.c:383)
    ==3576==    by 0x3D480432BF: run_queue (soup-session-async.c:418)
    ==3576==    by 0x3D48043912: idle_run_queue (soup-session-async.c:441)
    ==3576==    by 0x3D330427EC: g_main_context_dispatch (gmain.c:2441)
    ==3576==    by 0x3D33042FC7: g_main_context_iterate (gmain.c:3092)

 src/server/e-ews-connection.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/server/e-ews-connection.c b/src/server/e-ews-connection.c
index cfe48b0..6d91538 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -448,8 +448,10 @@ ews_response_cb (SoupSession *session, SoupMessage *msg, gpointer data)
 		} else
 			ews_parse_soap_fault (response, &error);
 
-		if (error)
+		if (error) {
 			g_simple_async_result_set_from_error (enode->simple, error);
+			g_clear_error (&error);
+		}
 
 		g_object_unref (response);
 	}



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