diff options
| author | Ezra Peisach <epeisach@mit.edu> | 2006-10-18 02:54:05 +0000 |
|---|---|---|
| committer | Ezra Peisach <epeisach@mit.edu> | 2006-10-18 02:54:05 +0000 |
| commit | 25452ebe24155c6f548bfc0d6840f6c34b5a4af3 (patch) | |
| tree | 003a216d9918aff2df0dc024f2b9cc01cb34720b /src/appl/sample/sclient | |
| parent | e880476a531ee3352664fb1e0fe2e83e43c6d7d0 (diff) | |
| download | krb5-25452ebe24155c6f548bfc0d6840f6c34b5a4af3.tar.gz krb5-25452ebe24155c6f548bfc0d6840f6c34b5a4af3.tar.xz krb5-25452ebe24155c6f548bfc0d6840f6c34b5a4af3.zip | |
Memory leak fixes on exit
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18727 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/appl/sample/sclient')
| -rw-r--r-- | src/appl/sample/sclient/sclient.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/appl/sample/sclient/sclient.c b/src/appl/sample/sclient/sclient.c index 46877211b0..6ad305a880 100644 --- a/src/appl/sample/sclient/sclient.c +++ b/src/appl/sample/sclient/sclient.c @@ -90,7 +90,7 @@ net_read(fd, buf, len) int main(int argc, char *argv[]) { - struct addrinfo *ap, aihints; + struct addrinfo *ap, aihints, *apstart; int aierr; int sock; krb5_context context; @@ -152,6 +152,7 @@ main(int argc, char *argv[]) } /* set up the address of the foreign socket for connect() */ + apstart = ap; /* For freeing later */ for (sock = -1; ap && sock == -1; ap = ap->ai_next) { char abuf[NI_MAXHOST], pbuf[NI_MAXSERV]; char mbuf[NI_MAXHOST + NI_MAXSERV + 64]; @@ -248,6 +249,7 @@ main(int argc, char *argv[]) com_err(argv[0], 0, "no error or reply from sendauth!"); exit(1); } + freeaddrinfo(apstart); krb5_free_context(context); exit(0); } |
