To plug a memory leak: uncommented a call to jsonObjectIteratorFree().
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 4 May 2009 14:17:11 +0000 (14:17 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 4 May 2009 14:17:11 +0000 (14:17 +0000)
This call was allegedly causing abends at some point in the past,
but my testing reveals no problems with it now.

Also: eliminated a couple of calls to oilsIDLFindPath().

git-svn-id: svn://svn.open-ils.org/ILS/trunk@13049 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/c-apps/oils_cstore.c

index e0ad238..52c5c3a 100644 (file)
@@ -3621,7 +3621,7 @@ char* SELECT (
                                                        if ( jsonObjectGetKeyConst( onode, "transform" ) ) {
                                                                string = searchFieldTransform(
                                                                        class_itr->key,
-                                                                       oilsIDLFindPath( "/%s/fields/%s", class_itr->key, order_itr->key ),
+                                                                       osrfHashGet( field_list_def, order_itr->key ),
                                                                        onode
                                                                );
                                                                if( ! string ) {
@@ -3702,7 +3702,7 @@ char* SELECT (
                                                }
 
                                        } // end while
-                   // jsonIteratorFree(order_itr);
+                   jsonIteratorFree(order_itr);
 
                                } else if ( snode->type == JSON_ARRAY ) {
 
@@ -4021,17 +4021,15 @@ static char* buildSELECT ( jsonObject* search_hash, jsonObject* order_hash, osrf
                                        jsonIterator* order_itr = jsonNewIterator( snode );
                                        while ( (onode = jsonIteratorNext( order_itr )) ) {
 
-                                               if (!oilsIDLFindPath( "/%s/fields/%s", class_itr->key, order_itr->key ))
+                                               osrfHash* field_def = oilsIDLFindPath( "/%s/fields/%s",
+                                                               class_itr->key, order_itr->key );
+                                               if ( !field_def )
                                                        continue;
 
                                                char* direction = NULL;
                                                if ( onode->type == JSON_HASH ) {
                                                        if ( jsonObjectGetKeyConst( onode, "transform" ) ) {
-                                                               string = searchFieldTransform(
-                                                                       class_itr->key,
-                                                                       oilsIDLFindPath( "/%s/fields/%s", class_itr->key, order_itr->key ),
-                                                                       onode
-                                                               );
+                                                               string = searchFieldTransform( class_itr->key, field_def, onode );
                                                                if( ! string ) {
                                                                        osrfAppSessionStatus(
                                                                                ctx->session,