]> diplodocus.org Git - nmh/blobdiff - sbr/mime_type.c
Specify yyyy-mm-dd date format for a man page's .TH date.
[nmh] / sbr / mime_type.c
index 673642d5b956bc9fe68effef9de0a154b9774feb..e4f3e5b8693deae5e1f9c8fbf4b3c06fae156539 100644 (file)
@@ -37,14 +37,15 @@ mime_type(const char *file_name) {
             if ((mimeencoding = get_file_info(MIMEENCODINGPROC, file_name))) {
                 content_type = concat(mimetype, "; charset=", mimeencoding,
                                       NULL);
+                free (mimetype);
             } else {
-                content_type = strdup(mimetype);
+                content_type = mimetype;
             }
         } else {
-            content_type = strdup(mimetype);
+            content_type = mimetype;
         }
 #else  /* MIMEENCODINGPROC */
-        content_type = strdup(mimetype);
+        content_type = mimetype;
 #endif /* MIMEENCODINGPROC */
     }
 #endif /* MIMETYPEPROC */
@@ -123,12 +124,10 @@ get_file_info(const char *proc, const char *file_name) {
             advise(NULL, "filenames containing both single and double quotes "
                    "are unsupported for attachment");
             return NULL;
-        } else {
-            quotec = "\"";
         }
+        quotec = "\"";
     }
 
-    cmd = concat(proc, " ", quotec, file_name, quotec, NULL);
     if ((cmd = concat(proc, " ", quotec, file_name, quotec, NULL))) {
         FILE *fp;