about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorThorben Günther <admin@xenrox.net>2021-03-11 21:05:35 +0100
committerThorben Günther <admin@xenrox.net>2021-03-11 21:05:35 +0100
commitc29343b8117489f8c69964bce5f966d13094b516 (patch)
tree8e48a809967d4a67fbbaa4629e81dd95e9f7c99c /src
parenta7ecda7773d037fbde7da68c70be2c48497366e1 (diff)
downloadprofani-tty-c29343b8117489f8c69964bce5f966d13094b516.tar.gz
Upload: Fix unused return
Diffstat (limited to 'src')
-rw-r--r--src/tools/http_upload.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/tools/http_upload.c b/src/tools/http_upload.c
index ff72e1b9..c30b74fa 100644
--- a/src/tools/http_upload.c
+++ b/src/tools/http_upload.c
@@ -203,15 +203,21 @@ http_file_put(void* userdata)
 
     // Optional headers
     if (upload->authorization) {
-        asprintf(&auth_header, "Authorization: %s", upload->authorization);
+        if (asprintf(&auth_header, "Authorization: %s", upload->authorization) == -1) {
+            auth_header = strdup(FALLBACK_MSG);
+        }
         headers = curl_slist_append(headers, auth_header);
     }
     if (upload->cookie) {
-        asprintf(&cookie_header, "Cookie: %s", upload->cookie);
+        if (asprintf(&cookie_header, "Cookie: %s", upload->cookie) == -1) {
+            cookie_header = strdup(FALLBACK_MSG);
+        }
         headers = curl_slist_append(headers, cookie_header);
     }
     if (upload->expires) {
-        asprintf(&expires_header, "Expires: %s", upload->expires);
+        if (asprintf(&expires_header, "Expires: %s", upload->expires) == -1) {
+            expires_header = strdup(FALLBACK_MSG);
+        }
         headers = curl_slist_append(headers, expires_header);
     }
 
@@ -244,7 +250,6 @@ http_file_put(void* userdata)
     curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)(upload->filesize));
     curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
 
-
     if ((res = curl_easy_perform(curl)) != CURLE_OK) {
         err = strdup(curl_easy_strerror(res));
     } else {