Skip to content

Commit 96a4b06

Browse files
committed
PCBC-663: make sure search object will not be double-freed
Change-Id: I702d43147250cb81d2fa9c6ec760a0e047d61f9e Reviewed-on: http://review.couchbase.org/123083 Tested-by: Build Bot <[email protected]> Reviewed-by: Sergey Avseyev <[email protected]>
1 parent a73fb5c commit 96a4b06

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/couchbase/bucket/cbft.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ static void ftsrow_callback(lcb_INSTANCE *instance, int ignoreme, const lcb_RESP
9797
}
9898
}
9999
zend_update_property(pcbc_search_result_impl_ce, return_value, ZEND_STRL("meta"), &meta TSRMLS_CC);
100-
Z_DELREF(meta);
101100
mval = zend_symtable_str_find(marr, ZEND_STRL("facets"));
102101
if (mval) {
103102
zend_update_property(pcbc_search_result_impl_ce, return_value, ZEND_STRL("facets"), mval TSRMLS_CC);
@@ -109,7 +108,6 @@ static void ftsrow_callback(lcb_INSTANCE *instance, int ignoreme, const lcb_RESP
109108
hits = zend_read_property(pcbc_search_result_impl_ce, return_value, ZEND_STRL("rows"), 0, &rv);
110109
add_next_index_zval(hits, &value);
111110
}
112-
zval_dtor(&value);
113111
}
114112
}
115113

@@ -131,6 +129,7 @@ PHP_METHOD(Cluster, searchQuery)
131129
array_init(&payload);
132130
add_assoc_str(&payload, "indexName", index);
133131
add_assoc_zval(&payload, "query", query);
132+
Z_ADDREF_P(query);
134133
if (options && Z_TYPE_P(options) != IS_NULL) {
135134
zval fname;
136135
zval values;

0 commit comments

Comments
 (0)