Commit 17ea1efe authored by Olivier Bertrand's avatar Olivier Bertrand

Fix using a null pointer. modified storage/connect/tabrest.cpp

parent 8c617e99
...@@ -229,8 +229,12 @@ PQRYRES __stdcall ColREST(PGLOBAL g, PTOS tp, char *tab, char *db, bool info) ...@@ -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 // Retrieve the file from the web and copy it locally
if (curl) if (curl)
rc = Xcurl(g, http, uri, filename); rc = Xcurl(g, http, uri, filename);
else else if (grf)
rc = grf(g->Message, trace(515), http, uri, filename); 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) if (rc)
return NULL; return NULL;
...@@ -296,13 +300,16 @@ bool RESTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) ...@@ -296,13 +300,16 @@ bool RESTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
curl = GetBoolCatInfo("Curl", curl); curl = GetBoolCatInfo("Curl", curl);
// Retrieve the file from the web and copy it locally // Retrieve the file from the web and copy it locally
if (curl) if (curl) {
rc = Xcurl(g, Http, Uri, filename); 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); rc = grf(g->Message, xt, Http, Uri, filename);
xtrc(515, "Return from restGetFile: rc=%d\n", rc);
if (xt) } else {
htrc("Return from restGetFile: rc=%d\n", rc); strcpy(g->Message, "Cannot access to curl nor casablanca");
rc = 1;
} // endif !grf
if (rc) if (rc)
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment