]> granicus.if.org Git - sudo/commitdiff
In replay_session() free iov at the end of the function (if needed)
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 9 May 2016 20:54:26 +0000 (14:54 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 9 May 2016 20:54:26 +0000 (14:54 -0600)
instead of after processing each line from the timing file.
Coverity CID 104843.

plugins/sudoers/sudoreplay.c

index 54238d0595aee282cc2f6a96cbe95a2bcf2a4866..9ff014abf6c90b5fd3a69a5e772f5e1f6c9f7cdb 100644 (file)
@@ -552,9 +552,9 @@ replay_session(const double max_wait, const char *decimal)
            sudo_ev_add(evbase, output_ev, NULL, false);
            sudo_ev_loop(evbase, 0);
        }
-       if (iov != &iovb)
-           free(iov);
     }
+    if (iov != &iovb)
+       free(iov);
     sudo_ev_base_free(evbase);
     sudo_ev_free(input_ev);
     sudo_ev_free(output_ev);