summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_loaddata.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2010-10-07 13:49:00 +0000
committerAndrey Hristov <andrey@php.net>2010-10-07 13:49:00 +0000
commit0e519d247ede738f6b09458a580c3a3a8ca5f733 (patch)
tree8d6564c56ff22dc622c4a0f2dafe91d2de8f3f55 /ext/mysqlnd/mysqlnd_loaddata.c
parent412d15168192fdd3afafca5cff034bb5b451942f (diff)
downloadphp-git-0e519d247ede738f6b09458a580c3a3a8ca5f733.tar.gz
fix some uninitialized variables. also fix shadowing of global symbols
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);
}