[open-ils-commits] r8175 - trunk/Open-ILS/src/c-apps
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Dec 8 22:11:02 EST 2007
Author: miker
Date: 2007-12-08 21:50:54 -0500 (Sat, 08 Dec 2007)
New Revision: 8175
Modified:
trunk/Open-ILS/src/c-apps/oils_cstore.c
Log:
freeing iterators after use
Modified: trunk/Open-ILS/src/c-apps/oils_cstore.c
===================================================================
--- trunk/Open-ILS/src/c-apps/oils_cstore.c 2007-12-09 01:57:43 UTC (rev 8174)
+++ trunk/Open-ILS/src/c-apps/oils_cstore.c 2007-12-09 02:50:54 UTC (rev 8175)
@@ -661,6 +661,7 @@
free(_s);
obj = doFieldmapperSearch(ctx, class_obj, _p, &err);
+ jsonObjectFree(_p);
if(err) return err;
jsonObjectNode* cur;
@@ -1321,6 +1322,7 @@
break;
}
+ jsonObjectIteratorFree(pred_itr);
} else if (node->type == JSON_NULL) { // IS NULL search
growing_buffer* _p = buffer_init(64);
buffer_fadd(
@@ -1530,6 +1532,8 @@
free(field);
}
+ jsonObjectIteratorFree(search_itr);
+
return buffer_release(join_buf);
}
@@ -1807,7 +1811,7 @@
char* pkey = osrfHashGet(idlClass, "primarykey");
char* tname = osrfHashGet(idlClass, "tablename");
- buffer_fadd(select_buf, " oils_i18n_xlate('%s', '%s', '%s', \"%s\".%s::TEXT, '%s') AS \"%s\"", tname, __column, pkey, cname, pkey, locale, __column);
+ buffer_fadd(select_buf, " oils_i18n_xlate('%s', '%s', '%s', \"%s\".%s::TEXT, '%s') AS \"%s\"", tname, __column, pkey, cname, pkey, locale, __column);
} else {
buffer_fadd(select_buf, " \"%s\".%s AS \"%s\"", cname, __column, __column);
}
@@ -1851,7 +1855,7 @@
char* pkey = osrfHashGet(idlClass, "primarykey");
char* tname = osrfHashGet(idlClass, "tablename");
- buffer_fadd(select_buf, " oils_i18n_xlate('%s', '%s', '%s', \"%s\".%s::TEXT, '%s') AS \"%s\"", tname, fname, pkey, cname, pkey, locale, __alias);
+ buffer_fadd(select_buf, " oils_i18n_xlate('%s', '%s', '%s', \"%s\".%s::TEXT, '%s') AS \"%s\"", tname, fname, pkey, cname, pkey, locale, __alias);
} else {
buffer_fadd(select_buf, " \"%s\".%s AS \"%s\"", cname, fname, __alias);
}
@@ -1891,8 +1895,11 @@
sel_pos++;
}
+ jsonObjectIteratorFree(select_itr);
}
+ jsonObjectIteratorFree(selclass_itr);
+
if (is_agg) jsonObjectFree(is_agg);
char* col_list = buffer_release(select_buf);
@@ -2031,6 +2038,8 @@
}
+ jsonObjectIteratorFree(order_itr);
+
} else if ( snode->item->type == JSON_ARRAY ) {
jsonObjectIterator* order_itr = jsonNewObjectIterator( snode->item );
@@ -2052,6 +2061,8 @@
}
+ jsonObjectIteratorFree(order_itr);
+
// IT'S THE OOOOOOOOOOOLD STYLE!
} else {
osrfLogError(OSRF_LOG_MARK, "%s: Possible SQL injection attempt; direct order by is not allowed", MODULENAME);
@@ -2074,6 +2085,8 @@
}
+ jsonObjectIteratorFree(class_itr);
+
string = buffer_release(group_buf);
if (strlen(string)) {
@@ -2212,7 +2225,7 @@
char* pkey = osrfHashGet(idlClass, "primarykey");
char* tname = osrfHashGet(idlClass, "tablename");
- buffer_fadd(select_buf, " oils_i18n_xlate('%s', '%s', '%s', \"%s\".%s::TEXT, '%s') AS \"%s\"", tname, fname, pkey, cname, pkey, locale, fname);
+ buffer_fadd(select_buf, " oils_i18n_xlate('%s', '%s', '%s', \"%s\".%s::TEXT, '%s') AS \"%s\"", tname, fname, pkey, cname, pkey, locale, fname);
} else {
buffer_fadd(select_buf, " \"%s\".%s", cname, fname);
}
@@ -2220,8 +2233,12 @@
buffer_fadd(select_buf, " \"%s\".%s", cname, fname);
}
}
+
+ jsonObjectIteratorFree(select_itr);
}
+ jsonObjectIteratorFree(class_itr);
+
char* col_list = buffer_release(select_buf);
char* table = getSourceDefinition(meta);
@@ -2330,6 +2347,8 @@
}
+ jsonObjectIteratorFree(order_itr);
+
} else {
string = jsonObjectToSimpleString(snode->item);
buffer_add(order_buf, string);
@@ -2339,6 +2358,8 @@
}
+ jsonObjectIteratorFree(class_itr);
+
string = buffer_release(order_buf);
if (strlen(string)) {
@@ -2555,6 +2576,7 @@
while ((_f = jsonObjectIteratorNext( _i ))) {
osrfStringArrayAdd( link_fields, jsonObjectToSimpleString( _f->item ) );
}
+ jsonObjectIteratorFree(_i);
}
}
More information about the open-ils-commits
mailing list