summaryrefslogtreecommitdiff
path: root/storage/connect/filamdbf.cpp
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2013-12-28 16:56:51 +0100
committerOlivier Bertrand <bertrandop@gmail.com>2013-12-28 16:56:51 +0100
commit32284eba5cfb82756799b0a88718aee272fd843c (patch)
treeca87b78f8c062e0dadfb46296788aed8471d9c38 /storage/connect/filamdbf.cpp
parentc055e5e0efcdd3750550230a483cdf8847b3d414 (diff)
downloadmariadb-git-32284eba5cfb82756799b0a88718aee272fd843c.tar.gz
- Fix variables used uninitialized
modified: storage/connect/filamdbf.cpp storage/connect/tabutil.cpp
Diffstat (limited to 'storage/connect/filamdbf.cpp')
-rw-r--r--storage/connect/filamdbf.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/storage/connect/filamdbf.cpp b/storage/connect/filamdbf.cpp
index c7ffe74c760..2b56e5c3d2f 100644
--- a/storage/connect/filamdbf.cpp
+++ b/storage/connect/filamdbf.cpp
@@ -178,18 +178,18 @@ static int dbfhead(PGLOBAL g, FILE *file, PSZ fn, DBFHEADER *buf)
/****************************************************************************/
PQRYRES DBFColumns(PGLOBAL g, const char *fn, BOOL info)
{
- static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING,
- TYPE_INT, TYPE_INT, TYPE_SHORT};
- static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME,
- FLD_PREC, FLD_LENGTH, FLD_SCALE};
- static unsigned int length[] = {11, 6, 8, 10, 10, 6};
+ int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING,
+ TYPE_INT, TYPE_INT, TYPE_SHORT};
+ XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME,
+ FLD_PREC, FLD_LENGTH, FLD_SCALE};
+ unsigned int length[] = {11, 6, 8, 10, 10, 6};
char buf[2], filename[_MAX_PATH];
int ncol = sizeof(buftyp) / sizeof(int);
int rc, type, len, field, fields;
BOOL bad;
DBFHEADER mainhead;
DESCRIPTOR thisfield;
- FILE *infile;
+ FILE *infile = NULL;
PQRYRES qrp;
PCOLRES crp;
@@ -228,8 +228,12 @@ PQRYRES DBFColumns(PGLOBAL g, const char *fn, BOOL info)
qrp = PlgAllocResult(g, ncol, fields, IDS_COLUMNS + 3,
buftyp, fldtyp, length, true, false);
- if (info || !qrp)
+ if (info || !qrp) {
+ if (infile)
+ fclose(infile);
+
return qrp;
+ } // endif info
if (trace) {
htrc("Structure of %s\n", filename);