]> granicus.if.org Git - php/commitdiff
Bail if allocation fails
authorAndrey Hristov <andrey@php.net>
Mon, 31 May 2010 17:09:13 +0000 (17:09 +0000)
committerAndrey Hristov <andrey@php.net>
Mon, 31 May 2010 17:09:13 +0000 (17:09 +0000)
ext/mysqlnd/mysqlnd_loaddata.c

index 267c3b8b7e5a9a9c010e736b360b1f1b8a45c9c9..1885cbc6d0ec6f981544a09b17944c16574fa852 100644 (file)
@@ -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)) {