From 750046bf9b5941ae57c1a05861e24dad04c1c4a4 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Tue, 19 Aug 2014 22:10:10 +0200 Subject: [PATCH] libstand: Add a missing free() in an error path. --- lib/libstand/tftp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libstand/tftp.c b/lib/libstand/tftp.c index 7c9af52e42..be7f098394 100644 --- a/lib/libstand/tftp.c +++ b/lib/libstand/tftp.c @@ -280,8 +280,10 @@ tftp_open(const char *path, struct open_file *f) return (ENOMEM); tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata)); - if (io == NULL) + if (io == NULL) { + free(tftpfile); return (EINVAL); + } io->destip = servip; tftpfile->off = 0; -- 2.41.0