[open-ils-commits] r8547 - trunk/Open-ILS/src/c-apps
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Jan 31 13:41:16 EST 2008
Author: miker
Date: 2008-01-31 13:13:37 -0500 (Thu, 31 Jan 2008)
New Revision: 8547
Modified:
trunk/Open-ILS/src/c-apps/oils_cstore.c
Log:
Patch from Scott McKellar plugging several pointer leaks
Modified: trunk/Open-ILS/src/c-apps/oils_cstore.c
===================================================================
--- trunk/Open-ILS/src/c-apps/oils_cstore.c 2008-01-30 21:56:40 UTC (rev 8546)
+++ trunk/Open-ILS/src/c-apps/oils_cstore.c 2008-01-31 18:13:37 UTC (rev 8547)
@@ -234,6 +234,7 @@
}
}
+ osrfStringArrayFree( global_methods );
return 0;
}
@@ -1180,8 +1181,6 @@
}
static char* searchFieldTransformPredicate (const char* class, osrfHash* field, jsonObjectNode* node) {
- growing_buffer* sql_buf = buffer_init(32);
-
char* field_transform = searchFieldTransform( class, field, node->item );
char* value = NULL;
@@ -1199,11 +1198,14 @@
if ( !dbi_conn_quote_string(dbhandle, &value) ) {
osrfLogError(OSRF_LOG_MARK, "%s: Error quoting key string [%s]", MODULENAME, value);
free(value);
+ free(field_transform);
return NULL;
}
}
}
+ growing_buffer* sql_buf = buffer_init(32);
+
buffer_fadd(
sql_buf,
"%s %s %s",
@@ -1212,6 +1214,7 @@
value
);
+ free(value);
free(field_transform);
return buffer_release(sql_buf);
@@ -1418,6 +1421,7 @@
leftclass
);
buffer_free(join_buf);
+ free(table);
return NULL;
}
fkey = strdup( fkey );
@@ -1434,6 +1438,7 @@
class
);
buffer_free(join_buf);
+ free(table);
return NULL;
}
field = strdup( field );
@@ -1480,6 +1485,7 @@
class
);
buffer_free(join_buf);
+ free(table);
return NULL;
}
@@ -1703,8 +1709,10 @@
}
// punt if we don't know about the core class
- if (!(core_meta = osrfHashGet( oilsIDL(), core_class )))
+ if (!(core_meta = osrfHashGet( oilsIDL(), core_class ))) {
+ free(core_class);
return NULL;
+ }
// if the select list is empty, or the core class field list is '*',
// build the default select list ...
@@ -2548,10 +2556,12 @@
*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