From 67eeb1a75209cab92e3dbe9a18ab014c81bc5a1b Mon Sep 17 00:00:00 2001 From: scottmk Date: Thu, 14 May 2009 11:24:59 +0000 Subject: [PATCH] In searchJOIN(): abort if recursive call fails. git-svn-id: svn://svn.open-ils.org/ILS/trunk@13158 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/c-apps/oils_cstore.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/c-apps/oils_cstore.c b/Open-ILS/src/c-apps/oils_cstore.c index 4a895bc06f..8175262e35 100644 --- a/Open-ILS/src/c-apps/oils_cstore.c +++ b/Open-ILS/src/c-apps/oils_cstore.c @@ -2396,9 +2396,18 @@ static char* searchJOIN ( const jsonObject* join_hash, osrfHash* leftmeta ) { const jsonObject* join_filter = jsonObjectGetKeyConst( snode, "join" ); if (join_filter) { char* jpred = searchJOIN( join_filter, idlClass ); - OSRF_BUFFER_ADD_CHAR( join_buf, ' ' ); - OSRF_BUFFER_ADD( join_buf, jpred ); - free(jpred); + if( jpred ) { + OSRF_BUFFER_ADD_CHAR( join_buf, ' ' ); + OSRF_BUFFER_ADD( join_buf, jpred ); + free(jpred); + } else { + osrfLogError( OSRF_LOG_MARK, "%s: Invalid nested join.", MODULENAME ); + jsonIteratorFree( search_itr ); + buffer_free( join_buf ); + if( freeable_hash ) + jsonObjectFree( freeable_hash ); + return NULL; + } } } -- 2.11.0