[open-ils-commits] r8954 - trunk/Open-ILS/src/c-apps
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Mar 10 01:07:47 EDT 2008
Author: miker
Date: 2008-03-10 00:34:46 -0400 (Mon, 10 Mar 2008)
New Revision: 8954
Modified:
trunk/Open-ILS/src/c-apps/oils_auth.c
Log:
Patch from Scott McKellar:
In oilsAuthGetTimeout() we make three calls to
osrf_settings_host_value_object(), which allocates a jsonObject.
However we were passing the return values directly to another
function, without capturing the pointers for freeing. As a result
we were leaking the jsonObjects thus allocated.
Modified: trunk/Open-ILS/src/c-apps/oils_auth.c
===================================================================
--- trunk/Open-ILS/src/c-apps/oils_auth.c 2008-03-10 04:30:59 UTC (rev 8953)
+++ trunk/Open-ILS/src/c-apps/oils_auth.c 2008-03-10 04:34:46 UTC (rev 8954)
@@ -210,22 +210,24 @@
if(!_oilsAuthOPACTimeout) { /* Load the default timeouts */
- _oilsAuthOPACTimeout =
- jsonObjectGetNumber(
- osrf_settings_host_value_object(
- "/apps/open-ils.auth/app_settings/default_timeout/opac"));
+ jsonObject* value_obj;
- _oilsAuthStaffTimeout =
- jsonObjectGetNumber(
- osrf_settings_host_value_object(
- "/apps/open-ils.auth/app_settings/default_timeout/staff" ));
+ value_obj = osrf_settings_host_value_object(
+ "/apps/open-ils.auth/app_settings/default_timeout/opac" );
+ _oilsAuthOPACTimeout = jsonObjectGetNumber(value_obj);
+ jsonObjectFree(value_obj);
- _oilsAuthOverrideTimeout =
- jsonObjectGetNumber(
- osrf_settings_host_value_object(
- "/apps/open-ils.auth/app_settings/default_timeout/temp" ));
+ value_obj = osrf_settings_host_value_object(
+ "/apps/open-ils.auth/app_settings/default_timeout/staff" );
+ _oilsAuthStaffTimeout = jsonObjectGetNumber(value_obj);
+ jsonObjectFree(value_obj);
+ value_obj = osrf_settings_host_value_object(
+ "/apps/open-ils.auth/app_settings/default_timeout/temp" );
+ _oilsAuthOverrideTimeout = jsonObjectGetNumber(value_obj);
+ jsonObjectFree(value_obj);
+
osrfLogInfo(OSRF_LOG_MARK, "Set default auth timetouts: opac => %d : staff => %d : temp => %d",
_oilsAuthOPACTimeout, _oilsAuthStaffTimeout, _oilsAuthOverrideTimeout );
}
More information about the open-ils-commits
mailing list