[rtems commit] Stop a resource leak

Sebastian Huber sebh at rtems.org
Mon Aug 26 07:45:45 UTC 2013


Module:    rtems
Branch:    master
Commit:    df533f10c0c3212d0e4d2610d4b7b67c84e1a3b1
Changeset: http://git.rtems.org/rtems/commit/?id=df533f10c0c3212d0e4d2610d4b7b67c84e1a3b1

Author:    Cynthia Rempel <cynthia at rtems.org>
Date:      Sun Aug 25 16:49:21 2013 -0700

Stop a resource leak

Stops a resource leak in the event that the system cannot malloc

---

 cpukit/libmisc/untar/untar.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/cpukit/libmisc/untar/untar.c b/cpukit/libmisc/untar/untar.c
index 5cebc2d..9ed00e9 100644
--- a/cpukit/libmisc/untar/untar.c
+++ b/cpukit/libmisc/untar/untar.c
@@ -281,6 +281,7 @@ Untar_FromFile(
 
    bufr = (char *)malloc(512);
    if (bufr == NULL) {
+      close(fd);
       return(UNTAR_FAIL);
    }
 




More information about the vc mailing list