1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

journal-upload: make the curl_slist cleanup actually work

If h is NULL, it is pointless to call curl_slist_free_all() on it...
This commit is contained in:
David Tardon 2021-03-17 12:20:11 +01:00
parent a6f575a1e8
commit 3851069709

View File

@ -182,23 +182,25 @@ int start_upload(Uploader *u,
assert(input_callback);
if (!u->header) {
struct curl_slist *h;
struct curl_slist *h, *l;
h = curl_slist_append(NULL, "Content-Type: application/vnd.fdo.journal");
if (!h)
return log_oom();
h = curl_slist_append(h, "Transfer-Encoding: chunked");
if (!h) {
l = curl_slist_append(h, "Transfer-Encoding: chunked");
if (!l) {
curl_slist_free_all(h);
return log_oom();
}
h = l;
h = curl_slist_append(h, "Accept: text/plain");
if (!h) {
l = curl_slist_append(h, "Accept: text/plain");
if (!l) {
curl_slist_free_all(h);
return log_oom();
}
h = l;
u->header = h;
}