From 22b0dc1f5ad6208f790e4cd8b9751fee0234b6b3 Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 11 Aug 2008 15:11:35 +0000 Subject: [PATCH] return workstation not found even if the results is a JSON NULL. free the NULL object git-svn-id: svn://svn.open-ils.org/ILS/trunk@10331 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/c-apps/oils_auth.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/c-apps/oils_auth.c b/Open-ILS/src/c-apps/oils_auth.c index 59ff65d06f..0dd980505b 100644 --- a/Open-ILS/src/c-apps/oils_auth.c +++ b/Open-ILS/src/c-apps/oils_auth.c @@ -320,7 +320,10 @@ static oilsEvent* oilsAuthVerifyWorkstation( const osrfMethodContext* ctx, jsonObject* userObj, const char* ws ) { osrfLogInfo(OSRF_LOG_MARK, "Attaching workstation to user at login: %s", ws); jsonObject* workstation = oilsUtilsFetchWorkstationByName(ws); - if(!workstation) return oilsNewEvent(OSRF_LOG_MARK, "WORKSTATION_NOT_FOUND"); + if(!workstation || workstation->type == JSON_NULL) { + jsonObjectFree(workstation); + return oilsNewEvent(OSRF_LOG_MARK, "WORKSTATION_NOT_FOUND"); + } long wsid = oilsFMGetObjectId(workstation); LONG_TO_STRING(wsid); char* orgid = oilsFMGetString(workstation, "owning_lib"); -- 2.11.0