[open-ils-commits] r11586 - trunk/Open-ILS/src/c-apps

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Dec 15 22:28:59 EST 2008


Author: miker
Date: 2008-12-15 22:28:58 -0500 (Mon, 15 Dec 2008)
New Revision: 11586

Modified:
   trunk/Open-ILS/src/c-apps/oils_cstore.c
Log:
#ifdef typo and a little refactoring

Modified: trunk/Open-ILS/src/c-apps/oils_cstore.c
===================================================================
--- trunk/Open-ILS/src/c-apps/oils_cstore.c	2008-12-15 21:32:56 UTC (rev 11585)
+++ trunk/Open-ILS/src/c-apps/oils_cstore.c	2008-12-16 03:28:58 UTC (rev 11586)
@@ -465,12 +465,9 @@
 int beginTransaction ( osrfMethodContext* ctx ) {
     OSRF_METHOD_VERIFY_CONTEXT(ctx);
 
-#ifdef PRCRUD
+#ifdef PCRUD
     jsonObject* user = verifyUserPCRUD( ctx );
-    if (!user) {
-        jsonObjectFree(user);
-        return -1;
-    }
+    if (!user) return -1;
     jsonObjectFree(user);
 #endif
 
@@ -500,13 +497,10 @@
     OSRF_METHOD_VERIFY_CONTEXT(ctx);
 
     int spNamePos = 0;
-#ifdef PRCRUD
+#ifdef PCRUD
     spNamePos = 1;
     jsonObject* user = verifyUserPCRUD( ctx );
-    if (!user) {
-        jsonObjectFree(user);
-        return -1;
-    }
+    if (!user) return -1;
     jsonObjectFree(user);
 #endif
 
@@ -548,13 +542,10 @@
     OSRF_METHOD_VERIFY_CONTEXT(ctx);
 
     int spNamePos = 0;
-#ifdef PRCRUD
+#ifdef PCRUD
     spNamePos = 1;
     jsonObject* user = verifyUserPCRUD( ctx );
-    if (!user) {
-        jsonObjectFree(user);
-        return -1;
-    }
+    if (!user) return -1;
     jsonObjectFree(user);
 #endif
 
@@ -596,13 +587,10 @@
     OSRF_METHOD_VERIFY_CONTEXT(ctx);
 
     int spNamePos = 0;
-#ifdef PRCRUD
+#ifdef PCRUD
     spNamePos = 1;
     jsonObject* user = verifyUserPCRUD( ctx );
-    if (!user) {
-        jsonObjectFree(user);
-        return -1;
-    }
+    if (!user) return -1;
     jsonObjectFree(user);
 #endif
 
@@ -643,12 +631,9 @@
 int commitTransaction ( osrfMethodContext* ctx ) {
     OSRF_METHOD_VERIFY_CONTEXT(ctx);
 
-#ifdef PRCRUD
+#ifdef PCRUD
     jsonObject* user = verifyUserPCRUD( ctx );
-    if (!user) {
-        jsonObjectFree(user);
-        return -1;
-    }
+    if (!user) return -1;
     jsonObjectFree(user);
 #endif
 
@@ -674,12 +659,9 @@
 int rollbackTransaction ( osrfMethodContext* ctx ) {
     OSRF_METHOD_VERIFY_CONTEXT(ctx);
 
-#ifdef PRCRUD
+#ifdef PCRUD
     jsonObject* user = verifyUserPCRUD( ctx );
-    if (!user) {
-        jsonObjectFree(user);
-        return -1;
-    }
+    if (!user) return -1;
     jsonObjectFree(user);
 #endif
 
@@ -863,11 +845,11 @@
         osrfAppSessionStatus( ctx->session, OSRF_STATUS_BADREQUEST, "osrfMethodException", ctx->request, m );
 
         free(m);
-        free(auth);
-
-        return jsonNULL;
+        jsonObjectFree(user);
+        user = jsonNULL;
     }
 
+    free(auth);
     return user;
 
 }



More information about the open-ils-commits mailing list