cvs: php4 /ext/ingres_ii ii.c
| From: | H�not David | Date: | Sat, 05 Aug 2000 03:22:13 +0000 |
| Subject: | cvs: php4 /ext/ingres_ii ii.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1043@lists.php.net to get a copy of this message | ||
henot Fri Aug 4 20:22:13 2000 EDT
Modified files:
/php4/ext/ingres_ii ii.c
Log:
Fix for a bug with persistent connections.
Index: php4/ext/ingres_ii/ii.c
diff -u php4/ext/ingres_ii/ii.c:1.5 php4/ext/ingres_ii/ii.c:1.6
--- php4/ext/ingres_ii/ii.c:1.5 Tue Jul 18 15:34:41 2000
+++ php4/ext/ingres_ii/ii.c Fri Aug 4 20:22:13 2000
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ii.c,v 1.5 2000/07/18 22:34:41 sas Exp $ */
+/* $Id: ii.c,v 1.6 2000/08/05 03:22:13 henot Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -154,7 +154,7 @@
IIapi_disconnect(&disconnParm);
- efree(link);
+ free(link);
IIG(num_links)--;
}
@@ -435,7 +435,7 @@
RETURN_FALSE;
}
- link = (II_LINK *) emalloc(sizeof(II_LINK));
+ link = (II_LINK *) malloc(sizeof(II_LINK));
link->connHandle = connParm.co_connHandle;
link->tranHandle = NULL;
link->stmtHandle = NULL;
@@ -447,6 +447,7 @@
new_le.ptr = link;
if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length+1, (void
*) &new_le, sizeof(list_entry), NULL)==FAILURE) {
php_error(E_WARNING,"Ingres II: Unable to hash (%s)", hashed_details);
+ free(link);
efree(hashed_details);
RETURN_FALSE;
}
@@ -516,7 +517,7 @@
RETURN_FALSE;
}
- link = (II_LINK *) emalloc(sizeof(II_LINK));
+ link = (II_LINK *) malloc(sizeof(II_LINK));
link->connHandle = connParm.co_connHandle;
link->tranHandle = NULL;
link->stmtHandle = NULL;
@@ -531,13 +532,14 @@
new_index_ptr.type = le_index_ptr;
if (zend_hash_update(&EG(regular_list),hashed_details,hashed_details_length+1,(void *)
&new_index_ptr, sizeof(list_entry), NULL)==FAILURE) {
php_error(E_WARNING,"Ingres II: Unable to hash (%s)", hashed_details);
+ free(link);
efree(hashed_details);
RETURN_FALSE;
}
IIG(num_links)++;
}
- efree(hashed_details);
+ efree(hashed_details);
php_ii_set_default_link(return_value->value.lval);
}