[Groonga-commit] groonga/groonga at 0595b64 [master] avoid double free when call grn_ctx_close

Back to archive index

do-aki null+****@clear*****
Fri Aug 8 15:35:52 JST 2014


do-aki	2014-08-08 15:35:52 +0900 (Fri, 08 Aug 2014)

  New Revision: 0595b64cfeb22b08781d19050f6953086b63bfdf
  https://github.com/groonga/groonga/commit/0595b64cfeb22b08781d19050f6953086b63bfdf

  Merged 9adf510: Merge pull request #184 from do-aki/groonga-php

  Message:
    avoid double free when call grn_ctx_close

  Modified files:
    bindings/php/groonga.c

  Modified: bindings/php/groonga.c (+1 -10)
===================================================================
--- bindings/php/groonga.c    2014-08-07 17:15:13 +0900 (0acb6d9)
+++ bindings/php/groonga.c    2014-08-08 15:35:52 +0900 (b92cc1a)
@@ -120,20 +120,11 @@ PHP_FUNCTION(grn_ctx_close)
   zval *res = NULL;
   int res_id = -1;
 
-  grn_ctx *ctx;
-  grn_rc rc;
-
-
   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
     return;
   }
 
-  ZEND_FETCH_RESOURCE(ctx, grn_ctx *, &res, res_id, "grn_ctx", le_grn_ctx);
-
-  if ((rc = grn_ctx_close(ctx)) != GRN_SUCCESS) {
-    RETURN_FALSE;
-  }
-
+  zend_list_delete(Z_LVAL_P(res)); // call grn_ctx_dtor
   RETURN_TRUE;
 }
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index