File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ static void close_fd_input(Uploader *u);
7272 } while (0)
7373
7474DEFINE_TRIVIAL_CLEANUP_FUNC_FULL (CURL * , curl_easy_cleanup , NULL);
75+ DEFINE_TRIVIAL_CLEANUP_FUNC_FULL (struct curl_slist * , curl_slist_free_all , NULL);
7576
7677static size_t output_callback (char * buf ,
7778 size_t size ,
@@ -182,27 +183,24 @@ int start_upload(Uploader *u,
182183 assert (input_callback );
183184
184185 if (!u -> header ) {
185- struct curl_slist * h , * l ;
186+ _cleanup_ (curl_slist_free_allp ) struct curl_slist * h = NULL ;
187+ struct curl_slist * l ;
186188
187189 h = curl_slist_append (NULL , "Content-Type: application/vnd.fdo.journal" );
188190 if (!h )
189191 return log_oom ();
190192
191193 l = curl_slist_append (h , "Transfer-Encoding: chunked" );
192- if (!l ) {
193- curl_slist_free_all (h );
194+ if (!l )
194195 return log_oom ();
195- }
196196 h = l ;
197197
198198 l = curl_slist_append (h , "Accept: text/plain" );
199- if (!l ) {
200- curl_slist_free_all (h );
199+ if (!l )
201200 return log_oom ();
202- }
203201 h = l ;
204202
205- u -> header = h ;
203+ u -> header = TAKE_PTR ( h ) ;
206204 }
207205
208206 if (!u -> easy ) {
You can’t perform that action at this time.
0 commit comments