[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pecl-cvs
Subject:    [PECL-CVS] com =?UTF-8?Q?pecl/database/ibm=5Fdb=32=3A=20Fix=20pconnect=20keepalive?= =?UTF-8?Q?=20ch
From:       Calvin Buckley <calvinb () php ! net>
Date:       2020-12-14 21:25:16
Message-ID: php-mail-5c6b9daba60fff75ebce66691f486586412328915 () git ! php ! net
[Download RAW message or body]

Commit:    d84d408c5468629215c02234d92af5852aa72027
Author:    Calvin Buckley <calvin@cmpct.info>         Mon, 14 Dec 2020 16:25:16 -0500
Parents:   e6efb27be0056dd959d8e783a88f82968b24c19c
Branches:  master

Link:       http://git.php.net/?p=pecl/database/ibm_db2.git;a=commitdiff;h=d84d408c5468629215c02234d92af5852aa72027


Log:
Fix pconnect keepalive check not freeing statement fully

The code to free statement resources frees everything held by the
structure, but not the statement resource itself, since I believe
these can be allocated outside of new_struct. The free code seems
to call the special free function then PHP efree, so we'll do the
same in the pconnect check.

Changed paths:
  M  ibm_db2.c


Diff:
diff --git a/ibm_db2.c b/ibm_db2.c
index 7a5d154..3e39968 100644
--- a/ibm_db2.c
+++ b/ibm_db2.c
@@ -2389,12 +2389,14 @@ static int _php_db2_connect_helper( \
INTERNAL_FUNCTION_PARAMETERS, conn_handle **  }
                     SQLFreeHandle( SQL_HANDLE_STMT, try_stmt_res->hstmt);
                     _php_db2_free_result_struct(try_stmt_res);
+                    efree(try_stmt_res);
                 /* 1.9.7 - IBM i level 3: try allocate new statement (check \
allocate) */  } else if (IBM_DB2_G(i5_check_pconnect) >= 3) {
                     try_stmt_res = _db2_new_stmt_struct(conn_res);
                     rc = SQLAllocHandle(SQL_HANDLE_STMT, conn_res->hdbc, \
&(try_stmt_res->hstmt));  SQLFreeHandle( SQL_HANDLE_STMT, try_stmt_res->hstmt);
                     _php_db2_free_result_struct(try_stmt_res);
+                    efree(try_stmt_res);
                 /* 1.9.7 - IBM i level 2: try conn get info (check meta data) */
                 } else if (IBM_DB2_G(i5_check_pconnect) >=2 ) {
                     memset(server, 0, sizeof(server));


--
PECL CVS Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic