[open-ils-commits] r8174 - trunk/Open-ILS/src/c-apps
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Dec 8 21:17:53 EST 2007
Author: miker
Date: 2007-12-08 20:57:43 -0500 (Sat, 08 Dec 2007)
New Revision: 8174
Modified:
trunk/Open-ILS/src/c-apps/oils_cstore.c
Log:
free returned objects in json_query
Modified: trunk/Open-ILS/src/c-apps/oils_cstore.c
===================================================================
--- trunk/Open-ILS/src/c-apps/oils_cstore.c 2007-12-08 20:22:18 UTC (rev 8173)
+++ trunk/Open-ILS/src/c-apps/oils_cstore.c 2007-12-09 01:57:43 UTC (rev 8174)
@@ -637,7 +637,7 @@
jsonObjectNode* cur;
jsonObjectIterator* itr = jsonNewObjectIterator( obj );
while ((cur = jsonObjectIteratorNext( itr ))) {
- osrfAppRespond( ctx, jsonObjectClone(cur->item) );
+ osrfAppRespond( ctx, cur->item );
}
jsonObjectIteratorFree(itr);
osrfAppRespondComplete( ctx, NULL );
@@ -668,17 +668,15 @@
while ((cur = jsonObjectIteratorNext( itr ))) {
osrfAppRespond(
ctx,
- jsonObjectClone(
- jsonObjectGetIndex(
- cur->item,
- atoi(
+ jsonObjectGetIndex(
+ cur->item,
+ atoi(
+ osrfHashGet(
osrfHashGet(
- osrfHashGet(
- osrfHashGet( class_obj, "fields" ),
- osrfHashGet( class_obj, "primarykey")
- ),
- "array_position"
- )
+ osrfHashGet( class_obj, "fields" ),
+ osrfHashGet( class_obj, "primarykey")
+ ),
+ "array_position"
)
)
)
@@ -2430,7 +2428,9 @@
osrfLogDebug(OSRF_LOG_MARK, "Query returned at least one row");
do {
- osrfAppRespond( ctx, oilsMakeJSONFromResult( result ) );
+ jsonObject* return_val = oilsMakeJSONFromResult( result );
+ osrfAppRespond( ctx, return_val );
+ jsonObjectFree( return_val );
} while (dbi_result_next_row(result));
} else {
@@ -3026,7 +3026,7 @@
static jsonObject* oilsMakeFieldmapperFromResult( dbi_result result, osrfHash* meta) {
if(!(result && meta)) return jsonNULL;
- jsonObject* object = jsonParseString("[]");
+ jsonObject* object = jsonNewObject(NULL);
jsonObjectSetClass(object, osrfHashGet(meta, "classname"));
osrfHash* fields = osrfHashGet(meta, "fields");
@@ -3136,7 +3136,7 @@
static jsonObject* oilsMakeJSONFromResult( dbi_result result ) {
if(!result) return jsonNULL;
- jsonObject* object = jsonParseString("{}");
+ jsonObject* object = jsonNewObject(NULL);
time_t _tmp_dt;
char dt_string[256];
More information about the open-ils-commits
mailing list