summaryrefslogtreecommitdiffstats
path: root/src/journal-remote
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2021-03-17 12:20:11 +0100
committerDavid Tardon <dtardon@redhat.com>2021-03-18 09:41:49 +0100
commit3851069709dbfc4729d206c208f0f773f6fb8da5 (patch)
treeae60404ff0d7f48399435b67fec35fe6a2baf47d /src/journal-remote
parentjournal-upload: cleanup CURL* on error (diff)
downloadsystemd-3851069709dbfc4729d206c208f0f773f6fb8da5.tar.xz
systemd-3851069709dbfc4729d206c208f0f773f6fb8da5.zip
journal-upload: make the curl_slist cleanup actually work
If h is NULL, it is pointless to call curl_slist_free_all() on it...
Diffstat (limited to 'src/journal-remote')
-rw-r--r--src/journal-remote/journal-upload.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c
index 9a7a4e92a4..af53f98d13 100644
--- a/src/journal-remote/journal-upload.c
+++ b/src/journal-remote/journal-upload.c
@@ -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;
}