From 613c2fe91b64bce9f581fcf28c536fb3b8263e0b Mon Sep 17 00:00:00 2001 From: des Date: Sat, 26 May 2001 17:23:38 +0000 Subject: [PATCH] Plug memory leak. PR: 27506 --- lib/libfetch/ftp.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c index 09b72ca7e4ad..0cc9910adaca 100644 --- a/lib/libfetch/ftp.c +++ b/lib/libfetch/ftp.c @@ -418,13 +418,10 @@ _ftp_closefn(void *v) io->dir = -1; io->dsd = -1; DEBUG(fprintf(stderr, "Waiting for final status\n")); - if ((r = _ftp_chkerr(io->csd)) != FTP_TRANSFER_COMPLETE) - io->err = r; - else - io->err = 0; + r = _ftp_chkerr(io->csd); close(io->csd); - io->csd = -1; - return io->err ? -1 : 0; + free(io); + return (r == FTP_TRANSFER_COMPLETE) ? 0 : -1; } static FILE *