]> granicus.if.org Git - curl/commitdiff
altsvc_out: check the return code from Curl_gmtime
authorDaniel Stenberg <daniel@haxx.se>
Sun, 3 Mar 2019 16:37:29 +0000 (17:37 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 3 Mar 2019 20:30:31 +0000 (21:30 +0100)
Pointed out by Coverity, CID 1442956.

Closes #3640

lib/altsvc.c

index 97cdc7b8a78b3e34ac1cabdd33d3ac5fe8a53d9b..64ca2655de1174a391813820d9623832fbd980bd 100644 (file)
@@ -216,7 +216,9 @@ static CURLcode altsvc_load(struct altsvcinfo *asi, const char *file)
 static CURLcode altsvc_out(struct altsvc *as, FILE *fp)
 {
   struct tm stamp;
-  Curl_gmtime(as->expires, &stamp);
+  CURLcode result = Curl_gmtime(as->expires, &stamp);
+  if(result)
+    return result;
 
   fprintf(fp,
           "%s %s %u "