com php-src: Fixed compilation: ext/mysqlnd/mysqlnd_auth.c
| From: | Dmitry Stogov | Date: | Fri, 20 Jun 2014 06:27:24 +0000 |
| Subject: | com php-src: Fixed compilation: ext/mysqlnd/mysqlnd_auth.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-78997@lists.php.net to get a copy of this message | ||
Commit: 7e9176731f299335a65602c298e1683543e88b6d
Author: Dmitry Stogov <dmitry@zend.com> Fri, 20 Jun 2014 10:27:24 +0400
Parents: d632870e4dfe506e21ddd4275351e7244060c942
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7e9176731f299335a65602c298e1683543e88b6d
Log:
Fixed compilation
Changed paths:
M ext/mysqlnd/mysqlnd_auth.c
Diff:
diff --git a/ext/mysqlnd/mysqlnd_auth.c b/ext/mysqlnd/mysqlnd_auth.c
index 7f554dc..326fc23 100644
--- a/ext/mysqlnd/mysqlnd_auth.c
+++ b/ext/mysqlnd/mysqlnd_auth.c
@@ -543,20 +543,18 @@ mysqlnd_sha256_get_rsa_key(MYSQLND_CONN_DATA * conn,
DBG_ERR("server_public_key is not set");
DBG_RETURN(NULL);
} else {
- char * key_str = NULL;
+ zend_string * key_str;
DBG_INF_FMT("Key in a file. [%s]", fname);
stream = php_stream_open_wrapper((char *) fname, "rb", REPORT_ERRORS, NULL);
if (stream) {
- if ((len = php_stream_copy_to_mem(stream, &key_str, PHP_STREAM_COPY_ALL, 0)) >= 0 ) {
- BIO * bio = BIO_new_mem_buf(key_str, len);
+ if ((key_str = php_stream_copy_to_mem(stream, PHP_STREAM_COPY_ALL, 0)) != NULL) {
+ BIO * bio = BIO_new_mem_buf(key_str->val, key_str->len);
ret = PEM_read_bio_RSA_PUBKEY(bio, NULL, NULL, NULL);
BIO_free(bio);
DBG_INF("Successfully loaded");
- }
- if (key_str) {
- DBG_INF_FMT("Public key:%*.s", len, key_str);
- efree(key_str);
+ DBG_INF_FMT("Public key:%*.s", key_str->len, key_str->val);
+ STR_RELEASE(key_str);
}
php_stream_free(stream, PHP_STREAM_FREE_CLOSE);
}