diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2013-03-17 09:48:37 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2013-03-17 09:48:37 +0000 |
commit | a0a18f5b84e8a8f3a23dbea0c0b6efbc21e0f21f (patch) | |
tree | 644923aefb436c9f964d226ec2284d59da528a6d /usr.sbin | |
parent | 65ebef8a6f5ba277d4e9aa9e9de7669f0c5c1e2d (diff) |
i missed the bit of maxime villards diff that took the client_free out of
oack on error.
his fix is better, so this marges all of it in.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/tftpd/tftpd.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/tftpd/tftpd.c b/usr.sbin/tftpd/tftpd.c index 21922f49a89..8eab5afb9f4 100644 --- a/usr.sbin/tftpd/tftpd.c +++ b/usr.sbin/tftpd/tftpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tftpd.c,v 1.12 2013/03/15 13:13:10 dlg Exp $ */ +/* $OpenBSD: tftpd.c,v 1.13 2013/03/17 09:48:36 dlg Exp $ */ /* * Copyright (c) 2012 David Gwynne <dlg@uq.edu.au> @@ -872,14 +872,12 @@ tftp_open(struct tftp_client *client, const char *filename) int ecode; ecode = validate_access(client, filename); - if (ecode) { - nak(client, ecode); - return; - } + if (ecode) + goto error; if (client->options) { if (oack(client) == -1) - return; + goto error; free(client->options); client->options = NULL; @@ -889,6 +887,8 @@ tftp_open(struct tftp_client *client, const char *filename) sendfile(client); return; +error: + nak(client, ecode); } /* @@ -1439,7 +1439,6 @@ oack(struct tftp_client *client) return (0); error: - client_free(client); return (-1); } |