Skip to content

Commit 3f28c4e

Browse files
committed
- Fix #55301 (pdo_odbc part) check if malloc succeded
1 parent 582c2fa commit 3f28c4e

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)