summaryrefslogtreecommitdiff
path: root/ext/pdo_odbc
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2011-07-28 10:37:04 +0000
committerPierre Joye <pajoye@php.net>2011-07-28 10:37:04 +0000
commita20deb1607104ff0d006f602db4ac62afab48706 (patch)
treee623d61796a8f09e70559183ab2cce3599287c92 /ext/pdo_odbc
parent8535adfb3106acec08f98c1969c1e12bdd2563ed (diff)
downloadphp-git-a20deb1607104ff0d006f602db4ac62afab48706.tar.gz
- Fix #55301 (pdo_odbc part) check if malloc succeded
Diffstat (limited to 'ext/pdo_odbc')
-rwxr-xr-xext/pdo_odbc/pdo_odbc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/pdo_odbc/pdo_odbc.c b/ext/pdo_odbc/pdo_odbc.c
index 83f9927c92..4065211b43 100755
--- a/ext/pdo_odbc/pdo_odbc.c
+++ b/ext/pdo_odbc/pdo_odbc.c
@@ -98,6 +98,9 @@ PHP_MINIT_FUNCTION(pdo_odbc)
char *instance = INI_STR("pdo_odbc.db2_instance_name");
if (instance) {
char *env = malloc(sizeof("DB2INSTANCE=") + strlen(instance));
+ if (!env) {
+ return FAILURE;
+ }
strcpy(env, "DB2INSTANCE=");
strcat(env, instance);
putenv(env);