--- libgpilotdCM/gnome-pilot-conduit-management.gob~	2005-06-26 02:44:11.000000000 -0400
+++ libgpilotdCM/gnome-pilot-conduit-management.gob	2005-06-26 03:19:04.000000000 -0400
@@ -339,8 +339,10 @@
 		/* g_message ("version = %s",version); */
 		if (version==NULL || g_strcasecmp (version,CONDUIT_XML_VERSION)!=0) {
 			g_warning ("incompatible version");
+			xmlFree (version);
 			return NULL;	
 		}
+		xmlFree (version);
 		/* g_message ("XML version is ok, creating entry"); */
 		ret = g_new (GnomePilotConduitMgmtData,1);
 		ret->string_attributes = g_hash_table_new (g_str_hash,g_str_equal);
@@ -368,22 +370,32 @@
 
 		if (id_string==NULL) {
 			g_warning ("error in XML, missing id_string");
+			xmlFree (type);
+			xmlFree (location);
 			return FALSE;
 		} else {
 			if (strchr (id_string,' ')) {
 				g_warning ("error in XML, id_string bad");
+				xmlFree (id_string);
+				xmlFree (type);
+				xmlFree (location);
 				return FALSE;
 			}
 		}
 		if (location==NULL) {
 			g_warning ("error in XML, missing location");
+			xmlFree (id_string);
+			xmlFree (type);
 			return FALSE;
 		}
 
-		if (g_strcasecmp (type,"shlib")==0) {
+		if (type && g_strcasecmp (type,"shlib")==0) {
 			obj->type = GNOME_PILOT_CONDUIT_TYPE_SHLIB;
 		} else {
 			g_warning ("Unknown conduit type");
+			xmlFree (id_string);
+			xmlFree (type);
+			xmlFree (location);
 			return FALSE;	
 		}
 		obj->location = g_strdup (location);
@@ -391,6 +403,9 @@
 		g_hash_table_insert (conduitid_to_datastruct,
 				    obj->id,
 				    obj);
+		xmlFree (id_string);
+		xmlFree (type);
+		xmlFree (location);
 		return TRUE;
 	}
 
@@ -428,6 +443,8 @@
 					current_name = g_strdup (value);
 				}
 				node = node->next;
+				xmlFree (value);
+				xmlFree (lang);
 			}
 		}
 		if (!current_name) {
@@ -462,10 +479,16 @@
 				if (value==NULL) {
 					g_warning ("attribute %s for %s(%s) has no value",
 						   name, obj->name, obj->id);
+					xmlFree (lang);
+					xmlFree (name);
+					xmlFree (type);
 					continue;
 				}
 				if (name==NULL) {
 					g_warning ("attribute has no name");
+					xmlFree (lang);
+					xmlFree (type);
+					xmlFree (value);
 					continue;
 				}
 
@@ -486,6 +509,10 @@
 					g_warning ("Unknown type %s",type);
 				}
 				
+				xmlFree (lang);
+				xmlFree (name);
+				xmlFree (type);
+				xmlFree (value);
 			} else if (g_strcasecmp (node->name, "text") == 0) {
 				/* ignore text */
 			} else if (!self_is_other_valid_tag (node->name)) { 
