ORBit2 r2084 - in trunk: . src/orb/orb-core



Author: jcolding
Date: Thu Sep  4 14:09:08 2008
New Revision: 2084
URL: http://svn.gnome.org/viewvc/ORBit2?rev=2084&view=rev

Log:
Fix memory leak

Modified:
   trunk/ChangeLog
   trunk/src/orb/orb-core/corba-loc.c

Modified: trunk/src/orb/orb-core/corba-loc.c
==============================================================================
--- trunk/src/orb/orb-core/corba-loc.c	(original)
+++ trunk/src/orb/orb-core/corba-loc.c	Thu Sep  4 14:09:08 2008
@@ -294,7 +294,7 @@
 		corbaloc += strlen("corbaloc:");
 	
 	/* dup. multi profile + object key */ 
-	loc = g_strdup (corbaloc);
+	loc = g_strdup (corbaloc); 
 
 	/* split at last '/' */ 
 	okey = strrchr (loc, '/');
@@ -341,18 +341,23 @@
 			
 		}
 	}
+	goto ret_ok;
 
-	CORBA_free (objkey);
+ret_error:
+	if (profiles) {
+		IOP_delete_profiles (NULL, &profiles);
+		profiles = NULL;
+	}
+
+ret_ok:
+	if (loc)
+		g_free (loc);        /* also free's okey */
+	if (token)
+		g_strfreev (token);
+	if (objkey)
+		CORBA_free (objkey);
 
 	return profiles;
-	
- ret_error:
-	if (loc)    g_free (loc);        /* also free's okey */
-	if (token)  g_strfreev (token);
-	if (objkey) CORBA_free (objkey);
-	if (profiles) IOP_delete_profiles (NULL, &profiles);
-		
-	return NULL;
 }
 
 static gboolean



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