(no commit message)
[prss.git] / src / phttp.c
index 81c8ad7..a1d0211 100644 (file)
@@ -103,8 +103,10 @@ static json_object *post(const char *url, const char *body)
 
        curl_easy_setopt(curl, CURLOPT_URL, url);
        curl_easy_setopt(curl, CURLOPT_VERBOSE, 0);
-       curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body);
-       curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(body));
+       if (body) {
+               curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body);
+               curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(body));
+       }
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cbk_curl);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk);