From ce3c7cd97284fb3edf4e0de6797678d5a54d0702 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Wed, 3 May 2017 10:39:32 +0200 Subject: [PATCH] Handle error return from SetPath --- storage/connect/tabjson.cpp | 4 +++- storage/connect/tabxml.cpp | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp index 76afd2d2e25..7984f6e1bfe 100644 --- a/storage/connect/tabjson.cpp +++ b/storage/connect/tabjson.cpp @@ -120,7 +120,9 @@ PQRYRES JSONColumns(PGLOBAL g, char *db, char *dsn, PTOS topt, bool info) return NULL; } // endif Fn - tdp->Database = SetPath(g, db); + if (!(tdp->Database = SetPath(g, db))) + return NULL; + tdp->Objname = GetStringTableOption(g, topt, "Object", NULL); tdp->Base = GetIntegerTableOption(g, topt, "Base", 0) ? 1 : 0; tdp->Pretty = GetIntegerTableOption(g, topt, "Pretty", 2); diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index f3411062c86..30854a113b6 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -157,7 +157,10 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info) tdp = new(g) XMLDEF; tdp->Fn = fn; - tdp->Database = SetPath(g, db); + + if (!(tdp->Database = SetPath(g, db))) + return NULL; + tdp->Tabname = tab; tdp->Zipped = GetBooleanTableOption(g, topt, "Zipped", false); tdp->Entry = GetStringTableOption(g, topt, "Entry", NULL);