krb5 commit: Don't leak work queue items in gss-server

Greg Hudson <[email protected]>
Newsgroups gmane.comp.encryption.kerberos.cvs
Message-ID <[email protected]>
https://github.com/krb5/krb5/commit/db479eb8d76e04ad3227263dd01e80d300c3fd9f
commit db479eb8d76e04ad3227263dd01e80d300c3fd9f
Author: Robbie Harwood <[email protected]>
Date:   Tue Jun 19 11:32:44 2018 -0400

    Don't leak work queue items in gss-server
    
    On accept() failure in gss-server.c, we would leak the freshly
    allocated work item.

 src/appl/gss-sample/gss-server.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/appl/gss-sample/gss-server.c b/src/appl/gss-sample/gss-server.c
index c0d0da3..6b5959a 100644
--- a/src/appl/gss-sample/gss-server.c
+++ b/src/appl/gss-sample/gss-server.c
@@ -781,6 +781,7 @@ main(int argc, char **argv)
                 /* Accept a TCP connection */
                 if ((work->s = accept(stmp, NULL, 0)) < 0) {
                     perror("accepting connection");
+                    free(work);
                     continue;
                 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.