[ruby-oci8-commit] [516] trunk/ruby-oci8: fix internal heap error in OCI.

nobody at rubyforge.org nobody at rubyforge.org
Tue Apr 24 12:46:35 UTC 2012


Revision: 516
Author:   kubo
Date:     2012-04-24 12:46:35 +0000 (Tue, 24 Apr 2012)
Log Message:
-----------
fix internal heap error in OCI.
(github issue #12 reported by Yasuo Honda)

Modified Paths:
--------------
    trunk/ruby-oci8/ChangeLog
    trunk/ruby-oci8/ext/oci8/metadata.c

Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog	2012-04-22 11:52:10 UTC (rev 515)
+++ trunk/ruby-oci8/ChangeLog	2012-04-24 12:46:35 UTC (rev 516)
@@ -1,3 +1,7 @@
+2012-04-24  KUBO Takehiro  <kubo at jiubao.org>
+	* ext/oci8/metadata.c: fix internal heap error in OCI.
+	    (github issue #12 reported by Yasuo Honda)
+
 2012-04-22  KUBO Takehiro  <kubo at jiubao.org>
 	* VERSION: update to 2.1.1.
 	* README.md: add links.

Modified: trunk/ruby-oci8/ext/oci8/metadata.c
===================================================================
--- trunk/ruby-oci8/ext/oci8/metadata.c	2012-04-22 11:52:10 UTC (rev 515)
+++ trunk/ruby-oci8/ext/oci8/metadata.c	2012-04-24 12:46:35 UTC (rev 516)
@@ -29,6 +29,11 @@
     rb_gc_mark(md->svc);
 }
 
+static void oci8_metadata_free(oci8_base_t *base)
+{
+    base->type = 0; /* to prevent OCIDescriptorFree */
+}
+
 VALUE oci8_metadata_create(OCIParam *parmhp, VALUE svc, VALUE parent)
 {
     oci8_metadata_t *md;
@@ -199,7 +204,7 @@
 
 oci8_base_vtable_t oci8_metadata_vtable = {
     oci8_metadata_mark,
-    NULL,
+    oci8_metadata_free,
     sizeof(oci8_metadata_t),
 };
 



More information about the ruby-oci8-commit mailing list