Ian Kent 20ded2
diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
Ian Kent 20ded2
index 06506a0..de8d515 100644
Ian Kent 20ded2
--- a/modules/lookup_ldap.c
Ian Kent 20ded2
+++ b/modules/lookup_ldap.c
Ian Kent 20ded2
@@ -549,7 +549,7 @@ static int parse_server_string(const char *url, struct lookup_context *ctxt)
Ian Kent 20ded2
 	const char *ptr, *name;
Ian Kent 20ded2
 	int l, al_len;
Ian Kent 20ded2
 
Ian Kent 20ded2
-	*proto = '\0';
Ian Kent 20ded2
+	memset(proto, 0, 9);
Ian Kent 20ded2
 	ptr = url;
Ian Kent 20ded2
 
Ian Kent 20ded2
 	debug(LOGOPT_NONE,
Ian Kent 20ded2
@@ -620,7 +620,7 @@ static int parse_server_string(const char *url, struct lookup_context *ctxt)
Ian Kent 20ded2
 	} else if (strchr(ptr, ':') != NULL) {
Ian Kent 20ded2
 		char *q = NULL;
Ian Kent 20ded2
 
Ian Kent 20ded2
-		/* Isolate the server(s). Include the port spec */
Ian Kent 20ded2
+		/* Isolate the server. Include the port spec */
Ian Kent 20ded2
 		q = strchr(ptr, ':');
Ian Kent 20ded2
 		if (isdigit(*q))
Ian Kent 20ded2
 			while (isdigit(*q))
Ian Kent 20ded2
@@ -633,7 +633,7 @@ static int parse_server_string(const char *url, struct lookup_context *ctxt)
Ian Kent 20ded2
 		}
Ian Kent 20ded2
 
Ian Kent 20ded2
 		l = q - ptr;
Ian Kent 20ded2
-		if (proto) {
Ian Kent 20ded2
+		if (*proto) {
Ian Kent 20ded2
 			al_len = l + strlen(proto) + 2;
Ian Kent 20ded2
 			tmp = malloc(al_len);
Ian Kent 20ded2
 		} else {