diff options
author | Andrey Hristov <andrey@php.net> | 2010-05-31 17:09:13 +0000 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2010-05-31 17:09:13 +0000 |
commit | 6ed619a351c9c306ef3fbd33ab95a2925d884220 (patch) | |
tree | 0afc9462546028988f2b7cbc43b6303834c2823b /ext/mysqlnd/mysqlnd_loaddata.c | |
parent | 8fc1e91e61b30f9b5b3e971ff4f1c52a3871239f (diff) | |
download | php-git-6ed619a351c9c306ef3fbd33ab95a2925d884220.tar.gz |
Bail if allocation fails
Diffstat (limited to 'ext/mysqlnd/mysqlnd_loaddata.c')
-rw-r--r-- | ext/mysqlnd/mysqlnd_loaddata.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/mysqlnd/mysqlnd_loaddata.c b/ext/mysqlnd/mysqlnd_loaddata.c index 267c3b8b7e..1885cbc6d0 100644 --- a/ext/mysqlnd/mysqlnd_loaddata.c +++ b/ext/mysqlnd/mysqlnd_loaddata.c @@ -53,7 +53,12 @@ int mysqlnd_local_infile_init(void **ptr, char *filename, void **userdata TSRMLS DBG_ENTER("mysqlnd_local_infile_init"); - *ptr = info = ((MYSQLND_INFILE_INFO *)mnd_ecalloc(1, sizeof(MYSQLND_INFILE_INFO))); + info = ((MYSQLND_INFILE_INFO *)mnd_ecalloc(1, sizeof(MYSQLND_INFILE_INFO))); + if (!info) { + DBG_RETURN(1); + } + + *ptr = info; /* check open_basedir */ if (PG(open_basedir)) { |