diff --git a/plugins/daap/rb-daap-plugin.c b/plugins/daap/rb-daap-plugin.c
index 20cc539..28a88b0 100644
--- a/plugins/daap/rb-daap-plugin.c
+++ b/plugins/daap/rb-daap-plugin.c
@@ -643,11 +643,13 @@ new_daap_share_location_added_cb (RBURIDialog *dialog,
 	int port = 3689;
 	DMAPMdnsBrowserService service;
 
-	host = g_strdup (location);
-	p = strrchr (host, ':');
+	p = strrchr (location, ':');
 	if (p != NULL) {
+		host = g_strndup (location, p-location);
 		port = strtoul (p+1, NULL, 10);
 		*p = '\0';
+	} else {
+		host = g_strdup (location);
 	}
 
 	rb_debug ("adding manually specified DAAP share at %s", location);
