summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c9827c1)
raw | patch | inline | side by side (parent: c9827c1)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 3 Jan 2011 16:41:33 +0000 (17:41 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 3 Jan 2011 16:41:33 +0000 (17:41 +0100) |
This resolved a segmentation fault.
src/curl_json.c | patch | blob | history |
diff --git a/src/curl_json.c b/src/curl_json.c
index 442cfcf97e36375b7b6fcc1b066fc00181dee12c..06119f1d2315e436a1fdc375c01e98bd25f21f34 100644 (file)
--- a/src/curl_json.c
+++ b/src/curl_json.c
return (-1);
}
+ url = NULL;
+ curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &url);
+
status = curl_easy_perform (curl);
if (status != 0)
{
ERROR ("curl_json plugin: curl_easy_perform failed with status %i: %s (%s)",
- status, db->curl_errbuf, url);
+ status, db->curl_errbuf, (url != NULL) ? url : "<null>");
yajl_free (db->yajl);
db->yajl = yprev;
return (-1);
}
- curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &url);
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &rc);
/* The response code is zero if a non-HTTP transport was used. */