curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*) &resp);
CURLcode result = curl_easy_perform(curl);
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp.code);
-
- json_object* resObj = NULL;
+
if (result != CURLE_OK || resp.code == 404)
returnState = NOTCONNECTED;
if (resp.code == 423)
returnState = BUSY;
+ json_object* resObj = NULL;
if (resp.code == 200) {
resObj = json_tokener_parse(resp.data);
json_object* valueObj = NULL;
json_object_object_get_ex(resObj, "SessionId", &valueObj);
sessionid = json_object_get_int64(valueObj);
+ valueObj = NULL;
returnState = OPENED;
}