summaryrefslogtreecommitdiff
path: root/ext/oci8/oci8.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/oci8/oci8.c')
-rw-r--r--ext/oci8/oci8.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index 809ff816ae..e47dbc7d8f 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -2054,7 +2054,14 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
connection->is_persistent = 0;
} else {
connection = (php_oci_connection *) calloc(1, sizeof(php_oci_connection));
+ if (connection == NULL) {
+ return NULL;
+ }
connection->hash_key = zend_strndup(hashed_details.c, hashed_details.len);
+ if (connection->hash_key == NULL) {
+ free(connection);
+ return NULL;
+ }
connection->is_persistent = 1;
}
} else {
@@ -2704,12 +2711,20 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha
ub4 poolmode = OCI_DEFAULT; /* Mode to be passed to OCISessionPoolCreate */
OCIAuthInfo *spoolAuth = NULL;
- /*Allocate sessionpool out of persistent memory */
+ /* Allocate sessionpool out of persistent memory */
session_pool = (php_oci_spool *) calloc(1, sizeof(php_oci_spool));
+ if (session_pool == NULL) {
+ iserror = 1;
+ goto exit_create_spool;
+ }
/* Populate key if passed */
if (hash_key_len) {
session_pool->spool_hash_key = zend_strndup(hash_key, hash_key_len);
+ if (session_pool->spool_hash_key == NULL) {
+ iserror = 1;
+ goto exit_create_spool;
+ }
}
/* Create the session pool's env */