Commit dc5937cb authored by jan.koester's avatar jan.koester
Browse files

http500 state for catch

fixed memleak
parent b98dc83a
Loading
Loading
Loading
Loading
+8 −0
Changes for src/authdb.cpp: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -381,6 +381,7 @@ namespace authdb {
                        }

                        editrec.append(curec);
                        delete[] curec.Data->data;
                    }
            }

@@ -444,6 +445,7 @@ namespace authdb {
        }

        void AdminController(libhttppp::HttpRequest *curreq, const int tid, ULONG_PTR args){
            try {
                if(strncmp(curreq->getRequestURL(),"/admin/listusers",16)==0){
                    listUsers(curreq,tid,args);
                }else if(strncmp(curreq->getRequestURL(),"/admin/createuser",17)==0){
@@ -464,6 +466,12 @@ namespace authdb {
                    rep.setContentLength(out.size());
                    rep.send(curreq,out.c_str(),out.size());
                }
            }catch(AuthBackendError &e){
                    libhttppp::HttpResponse rep;
                    rep.setState(HTTP500);
                    rep.setContentType("text/html");
                    rep.send(curreq,e.what(),strlen(e.what()));
            }
        }

        void RequestEvent(libhttppp::HttpRequest *curreq, const int tid, ULONG_PTR args){