Author: mladen.turk(a)jboss.com
Date: 2007-09-28 03:31:45 -0400 (Fri, 28 Sep 2007)
New Revision: 1052
Modified:
trunk/sight/native/share/no.c
Log:
Fix using nonallocated memory
Modified: trunk/sight/native/share/no.c
===================================================================
--- trunk/sight/native/share/no.c 2007-09-27 07:41:01 UTC (rev 1051)
+++ trunk/sight/native/share/no.c 2007-09-28 07:31:45 UTC (rev 1052)
@@ -115,10 +115,10 @@
sight_object_t *no;
UNREFERENCED_STDARGS;
- no = (sight_object_t *)calloc(1, sizeof(sight_object_t));
- if (!no) {
- throwAprMemoryException(_E, THROW_FMARK,
- apr_get_os_error());
+ if (!(no = (sight_object_t *)sight_calloc(_E,
+ sizeof(sight_object_t),
+ THROW_FMARK))) {
+ return 0;
}
no->cb.name = "callback";
no->cb.msig = "(Ljava/lang/Object;)I";
@@ -128,7 +128,6 @@
return P2J(no);
}
-static int created = 0;
SIGHT_EXPORT_DECLARE(void, NativeObject, init0)(SIGHT_STDARGS,
jobject thiz,
jlong instance,
Show replies by date