Two (potential ) memleak fixes

Michael Jansen kde at michael-jansen.biz
Wed Jul 29 11:59:25 PDT 2009


Hi 

while using valgrind to check ksmserver (kde) i stumbled about the following 
possible memleaks.

Please cc me as i'm not subscribed to this list.

Mike

1. libSM
-----------------------

diff --git a/src/sm_process.c b/src/sm_process.c
index 1c81020..3bf48c4 100644
--- a/src/sm_process.c
+++ b/src/sm_process.c
@@ -852,6 +852,7 @@ _SmsProcessMessage(IceConn iceConn, IcePointer clientData, 
int opcode,
            smsConn->callbacks.delete_properties.manager_data,
            count, propNames);

+       free(propNames);
        break;
     }



2. libX11
-------------------------

diff --git a/modules/im/ximcp/imInsClbk.c b/modules/im/ximcp/imInsClbk.c
index 3f384f4..d64afbd 100644
--- a/modules/im/ximcp/imInsClbk.c
+++ b/modules/im/ximcp/imInsClbk.c
@@ -207,6 +207,7 @@ _XimRegisterIMInstantiateCallback(
     if( xim ) {
 	lock = True;
 	xim->methods->close( (XIM)xim );
+	XFree(xim);
 	lock = False;
 	icb->call = True;
 	callback( display, client_data, NULL );




More information about the xorg-devel mailing list