Skip to content

Commit c1c09bb

Browse files
committed
openssl: fix memory leaks when session callback returns wrong type
1 parent 0173ef4 commit c1c09bb

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
@@ -1634,13 +1634,12 @@ static SSL_SESSION *php_openssl_session_get_cb(SSL *ssl, const unsigned char *se
16341634
SSL_SESSION_up_ref(obj->session);
16351635
session = obj->session;
16361636
}
1637-
zval_ptr_dtor(&retval);
16381637
} else if (Z_TYPE(retval) != IS_NULL) {
16391638
zend_type_error("session_get_cb return type must be null or OpenSSLSession");
1640-
return NULL;
16411639
}
16421640
}
16431641

1642+
zval_ptr_dtor(&retval);
16441643
zval_ptr_dtor(&args[1]);
16451644

16461645
*copy = 0;

0 commit comments

Comments
 (0)