properly handle meter channel count changes
[ardour.git] / gtk2_ardour / ardour_http.cc
index 569c0e2197120a4b65864b13b12ab7cecd888e7c..3ffea61b33013647fa8097663677b8794fef8b69 100644 (file)
@@ -141,7 +141,8 @@ HttpGet::~HttpGet ()
 char*
 HttpGet::get (const char* url)
 {
-       if (!_curl) {
+       _status = _result = -1;
+       if (!_curl || !url) {
                return NULL;
        }
 
@@ -151,7 +152,9 @@ HttpGet::get (const char* url)
 
        if (!persist) {
                free (mem.data);
-       }
+       } // otherwise caller is expected to have free()d or re-used it.
+
+       mem.data = NULL;
        mem.size = 0;
 
        curl_easy_setopt (_curl, CURLOPT_URL, url);