Skip to content

Commit 27af30d

Browse files
authored
Merge pull request #84 from datastax/112
112 - Fix: Freeing a null future as result of a failure in DefaultSession::…
2 parents ca6d5ac + ee07756 commit 27af30d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ext/src/Cassandra/DefaultSession.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -664,8 +664,7 @@ PHP_METHOD(DefaultSession, executeAsync)
664664
CassStatement *single = NULL;
665665
CassBatch *batch = NULL;
666666

667-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|z", &statement,
668-
cassandra_statement_ce, &options) == FAILURE) {
667+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &statement, &options) == FAILURE) {
669668
return;
670669
}
671670

ext/src/Cassandra/FutureRows.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ php_cassandra_future_rows_free(php5to7_zend_object_free *object TSRMLS_DC)
132132
php_cassandra_del_ref(&self->statement);
133133
php_cassandra_del_ref(&self->result);
134134

135-
cass_future_free(self->future);
135+
if (self->future) {
136+
cass_future_free(self->future);
137+
}
136138

137139
zend_object_std_dtor(&self->zval TSRMLS_CC);
138140
PHP5TO7_MAYBE_EFREE(self);

0 commit comments

Comments
 (0)