summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_loaddata.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqlnd/mysqlnd_loaddata.c')
-rw-r--r--ext/mysqlnd/mysqlnd_loaddata.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/mysqlnd/mysqlnd_loaddata.c b/ext/mysqlnd/mysqlnd_loaddata.c
index 516886d2d4..4623898248 100644
--- a/ext/mysqlnd/mysqlnd_loaddata.c
+++ b/ext/mysqlnd/mysqlnd_loaddata.c
@@ -173,7 +173,7 @@ static const char *lost_conn = "Lost connection to MySQL server during LOAD DATA
enum_func_status
mysqlnd_handle_local_infile(MYSQLND *conn, const char *filename, zend_bool *is_warning TSRMLS_DC)
{
- char *buf;
+ char *buf = NULL;
char empty_packet[MYSQLND_HEADER_SIZE];
enum_func_status result = FAIL;
unsigned int buflen = 4096;
@@ -244,7 +244,9 @@ infile_error:
}
(*conn->infile.local_infile_end)(info TSRMLS_CC);
- mnd_efree(buf);
+ if (buf) {
+ mnd_efree(buf);
+ }
DBG_INF_FMT("%s", result == PASS? "PASS":"FAIL");
DBG_RETURN(result);
}