Hi,

This fixes a resource leak in the event the system cannot allocate more 
memory...

Thanks,
Cindy
From 5771ed4f4980100f06b5a26a3e084ce1019f64a2 Mon Sep 17 00:00:00 2001
From: Cynthia Rempel <cynt...@rtems.org>
Date: Sun, 25 Aug 2013 16:49:21 -0700
Subject: [PATCH] Stop a resource leak

Stops a resource leak in the event that the system cannot malloc
---
 cpukit/libmisc/untar/untar.c | 1 +
 1 file changed, 1 insertion(+)

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);
    }
 
-- 
1.8.1.2

_______________________________________________
rtems-devel mailing list
rtems-devel@rtems.org
http://www.rtems.org/mailman/listinfo/rtems-devel

Reply via email to