]> diplodocus.org Git - nmh/commitdiff
Protect repl -file against dereference of null mp.
authorDavid Levine <levinedl@acm.org>
Tue, 20 Dec 2016 16:48:27 +0000 (11:48 -0500)
committerDavid Levine <levinedl@acm.org>
Tue, 20 Dec 2016 16:48:27 +0000 (11:48 -0500)
uip/repl.c

index f97210c..7f0c7ba 100644 (file)
@@ -452,14 +452,16 @@ try_it_again:
     fclose (in);
 
     {
-       char *filename = concat (mp->foldpath, "/", msg, NULL);
+        char *filename = file ? file : concat (mp->foldpath, "/", msg, NULL);
 
         for (n = 0; n < svector_size (convert_types); ++n) {
             add_convert_header (svector_at (convert_types, n),
                                 svector_at (convert_args, n),
                                 filename, drft);
         }
-       free (filename);
+        if (! file) {
+            free (filename);
+        }
     }
 
     if (nwhat)