]> diplodocus.org Git - nmh/commitdiff
Rearranged statements to eliminate memory allocation.
authorDavid Levine <levinedl@acm.org>
Sat, 17 Jun 2017 17:42:59 +0000 (13:42 -0400)
committerDavid Levine <levinedl@acm.org>
Sat, 17 Jun 2017 17:42:59 +0000 (13:42 -0400)
Update to commit a5bf16c0928cb4044b082f9cf6f44f9bb3998824.

uip/mhshowsbr.c

index 29c7c43..6f8a978 100644 (file)
@@ -499,20 +499,15 @@ show_content_aux2 (CT ct, int alternate, char *cracked, char *buffer,
 
        default: {
            int status;
 
        default: {
            int status;
-            char *display_prog = NULL;
-
-            if (vecp > 2  &&  vec[2][0] != '\0') {
+            char *display_prog = vecp > 2  &&  vec[2][0] != '\0'
                 /* Copy the real display program name.  This relies on the
                    specific construction of vec[] by argsplit(). */
                 /* Copy the real display program name.  This relies on the
                    specific construction of vec[] by argsplit(). */
-                display_prog = mh_xstrdup(vec[2]);
-            }
-
-            arglist_free(file, vec);
+                ?  vec[2]
+                :  NULL;
 
             pidcheck ((status = pidXwait (child_id, display_prog)));
 
 
             pidcheck ((status = pidXwait (child_id, display_prog)));
 
-            mh_xfree(display_prog);
-
+            arglist_free(file, vec);
            if (fd != NOTOK)
                (*ct->c_ceclosefnx) (ct);
            return (alternate ? OK : status);
            if (fd != NOTOK)
                (*ct->c_ceclosefnx) (ct);
            return (alternate ? OK : status);