Blob Blame History Raw
diff -up mutt-1.10.1/crypt-gpgme.c.mutt-1.9.3-1_coverity_76 mutt-1.10.1/crypt-gpgme.c
--- mutt-1.10.1/crypt-gpgme.c.mutt-1.9.3-1_coverity_76	2018-10-25 14:45:49.563438618 +0200
+++ mutt-1.10.1/crypt-gpgme.c	2018-10-25 14:51:49.293461260 +0200
@@ -562,6 +562,7 @@ static char *data_object_to_tempfile (gp
   char tempfb[_POSIX_PATH_MAX];
   FILE *fp;
   size_t nread = 0;
+  char * ret = NULL;
 
   if (!tempf)
     {
@@ -604,7 +605,15 @@ static char *data_object_to_tempfile (gp
     }
   if (ret_fp)
     *ret_fp = fp;
-  return safe_strdup (tempf);
+
+  if ((ret =  safe_strdup (tempf)) == NULL)
+    {
+      mutt_perror _("Can't allocate memory!");
+      unlink (tempf);
+      safe_fclose (&fp);
+      return NULL;
+    }
+  return ret;
 }