Skip to content

Commit b5c17e7

Browse files
authored
openssl: fix memory leaks when session callback returns wrong type (php#21966)
1 parent 72244e6 commit b5c17e7

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

ext/openssl/xp_ssl.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,13 +2051,12 @@ static SSL_SESSION *php_openssl_session_get_cb(SSL *ssl, const unsigned char *se
20512051
SSL_SESSION_up_ref(obj->session);
20522052
session = obj->session;
20532053
}
2054-
zval_ptr_dtor(&retval);
20552054
} else if (Z_TYPE(retval) != IS_NULL) {
20562055
zend_type_error("session_get_cb return type must be null or OpenSSLSession");
2057-
return NULL;
20582056
}
20592057
}
20602058

2059+
zval_ptr_dtor(&retval);
20612060
zval_ptr_dtor(&args[1]);
20622061

20632062
*copy = 0;

0 commit comments

Comments
 (0)