diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2020-11-11 17:41:11 +0100 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2020-11-11 17:41:11 +0100 |
commit | 17ea1efe0a06e95a15f7355986f890f995530c56 (patch) | |
tree | 7c7e0a6210ef9c31fb459256ace875e3a352e6a9 | |
parent | 8c617e99015c8aec1eb597698ebbdc0fcbd068fb (diff) | |
download | mariadb-git-17ea1efe0a06e95a15f7355986f890f995530c56.tar.gz |
Fix using a null pointer. modified storage/connect/tabrest.cpp
-rw-r--r-- | storage/connect/tabrest.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/storage/connect/tabrest.cpp b/storage/connect/tabrest.cpp index a41ca5dec87..a38e8bb5fec 100644 --- a/storage/connect/tabrest.cpp +++ b/storage/connect/tabrest.cpp @@ -229,8 +229,12 @@ PQRYRES __stdcall ColREST(PGLOBAL g, PTOS tp, char *tab, char *db, bool info) // Retrieve the file from the web and copy it locally if (curl) rc = Xcurl(g, http, uri, filename); - else + else if (grf) rc = grf(g->Message, trace(515), http, uri, filename); + else { + strcpy(g->Message, "Cannot access to curl nor casablanca"); + rc = 1; + } // endif !grf if (rc) return NULL; @@ -296,13 +300,16 @@ bool RESTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) curl = GetBoolCatInfo("Curl", curl); // Retrieve the file from the web and copy it locally - if (curl) + if (curl) { rc = Xcurl(g, Http, Uri, filename); - else + xtrc(515, "Return from Xcurl: rc=%d\n", rc); + } else if (grf) { rc = grf(g->Message, xt, Http, Uri, filename); - - if (xt) - htrc("Return from restGetFile: rc=%d\n", rc); + xtrc(515, "Return from restGetFile: rc=%d\n", rc); + } else { + strcpy(g->Message, "Cannot access to curl nor casablanca"); + rc = 1; + } // endif !grf if (rc) return true; |