[open-ils-commits] r8558 - trunk/Open-ILS/src/c-apps
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Jan 31 17:08:09 EST 2008
Author: miker
Date: 2008-01-31 16:40:30 -0500 (Thu, 31 Jan 2008)
New Revision: 8558
Modified:
trunk/Open-ILS/src/c-apps/oils_cstore.c
Log:
moving dedup to just where it is needed
Modified: trunk/Open-ILS/src/c-apps/oils_cstore.c
===================================================================
--- trunk/Open-ILS/src/c-apps/oils_cstore.c 2008-01-31 20:52:21 UTC (rev 8557)
+++ trunk/Open-ILS/src/c-apps/oils_cstore.c 2008-01-31 21:40:30 UTC (rev 8558)
@@ -1173,7 +1173,7 @@
} else {
buffer_fadd( sql_buf, "\"%s\".%s", class, osrfHashGet(field, "name"));
- }
+ }
if (field_transform) free(field_transform);
@@ -2518,10 +2518,10 @@
osrfLogDebug(OSRF_LOG_MARK, "%s SQL = %s", MODULENAME, sql);
dbi_result result = dbi_conn_query(dbhandle, sql);
- osrfHash* dedup = osrfNewHash();
jsonObject* res_list = jsonParseString("[]");
if(result) {
osrfLogDebug(OSRF_LOG_MARK, "Query returned with no errors");
+ osrfHash* dedup = osrfNewHash();
if (dbi_result_first_row(result)) {
/* JSONify the result */
@@ -2541,6 +2541,8 @@
osrfLogDebug(OSRF_LOG_MARK, "%s returned no results for query %s", MODULENAME, sql);
}
+ osrfHashFree(dedup);
+
/* clean up the query */
dbi_result_free(result);
@@ -2556,12 +2558,10 @@
*err = -1;
free(sql);
jsonObjectFree(res_list);
- osrfHashFree(dedup);
return jsonNULL;
}
- osrfHashFree(dedup);
free(sql);
if (res_list->size && order_hash) {
More information about the open-ils-commits
mailing list