From 72d866fdd7445d7568b90e190e04167192ae7893 Mon Sep 17 00:00:00 2001 From: scottmk Date: Mon, 4 May 2009 14:17:11 +0000 Subject: [PATCH] To plug a memory leak: uncommented a call to jsonObjectIteratorFree(). 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 | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Open-ILS/src/c-apps/oils_cstore.c b/Open-ILS/src/c-apps/oils_cstore.c index e0ad2382fa..52c5c3adc3 100644 --- a/Open-ILS/src/c-apps/oils_cstore.c +++ b/Open-ILS/src/c-apps/oils_cstore.c @@ -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, -- 2.11.0