]> granicus.if.org Git - cronie/commitdiff
Comment not freeing mailfrom - found during code review.
authorMarcela Mašláňová <mmaslano@redhat.com>
Mon, 21 Feb 2011 12:33:08 +0000 (13:33 +0100)
committerMarcela Mašláňová <mmaslano@redhat.com>
Mon, 21 Feb 2011 12:33:08 +0000 (13:33 +0100)
src/do_command.c

index 744427ca3eb6d11e4fd8d4344a023ea406aad688..5415e05e1ef7393e1afb09c01f7d26e6b54599fe 100644 (file)
@@ -372,6 +372,9 @@ static void child_process(entry * e, user * u) {
 
                        /* get sender address.  this is MAILFROM if set (and safe),
                         * root otherwise.
+                        * mailfrom is not freed because it lives only in this short
+                        * child process. Freeing could lead to segfaul, when mailfrom
+                        * is acquired from env_get function.
                         */
                        if (!mailfrom || !*mailfrom || !safe_p(usernm, mailfrom)) {
                                mailfrom = calloc(5, sizeof (char));