Skip to content

Commit 85538e1

Browse files
author
pajoye
committed
- Fix #55301 (pdo_odbc part) check if malloc succeded
git-svn-id: http://svn.php.net/repository/php/php-src/trunk@313828 c90b9560-bf6c-de11-be94-00142212c4b1
1 parent f819a28 commit 85538e1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ext/pdo_odbc/pdo_odbc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ PHP_MINIT_FUNCTION(pdo_odbc)
9898
char *instance = INI_STR("pdo_odbc.db2_instance_name");
9999
if (instance) {
100100
char *env = malloc(sizeof("DB2INSTANCE=") + strlen(instance));
101+
if (!env) {
102+
return FAILURE;
103+
}
101104
strcpy(env, "DB2INSTANCE=");
102105
strcat(env, instance);
103106
putenv(env);

0 commit comments

Comments
 (0)