Fix the segault on server shutdown that crept in when we decided to
authorDave West <davew@uncensored.citadel.org>
Sat, 26 Jan 2008 18:57:31 +0000 (18:57 +0000)
committerDave West <davew@uncensored.citadel.org>
Sat, 26 Jan 2008 18:57:31 +0000 (18:57 +0000)
purge users at logout.

citadel/user_ops.c

index 9cb18c870c25ac8030b9cf1e62d3b5c5322a93a9..974e1da8b51187fc9a60357de46dbf8f4ab342e6 100644 (file)
@@ -810,6 +810,10 @@ int purge_user(char pname[])
 
        makeuserkey(usernamekey, pname);
 
+       /* If the name is empty we can't find them in the DB any way so just return */
+       if (IsEmptyStr(pname))
+               return (ERROR + NO_SUCH_USER);
+
        if (getuser(&usbuf, pname) != 0) {
                lprintf(CTDL_ERR, "Cannot purge user <%s> - not found\n", pname);
                return (ERROR + NO_SUCH_USER);