All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] dosfstools-2.11: Fix memory leak in mkdosfs
@ 2015-08-06  9:06 Amarnath Valluri
  2015-08-06  9:12 ` Alexander Kanavin
  0 siblings, 1 reply; 12+ messages in thread
From: Amarnath Valluri @ 2015-08-06  9:06 UTC (permalink / raw)
  To: openembedded-core

Added new patch that fixes the memory leak that was introduced in
mkdosfs-dir.patch.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 .../dosfstools/dosfstools-Fix-memroy-leak.patch    | 30 ++++++++++++++++++++++
 .../recipes-devtools/dosfstools/dosfstools_2.11.bb |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 meta/recipes-devtools/dosfstools/dosfstools/dosfstools-Fix-memroy-leak.patch

diff --git a/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-Fix-memroy-leak.patch b/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-Fix-memroy-leak.patch
new file mode 100644
index 0000000..555250f
--- /dev/null
+++ b/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-Fix-memroy-leak.patch
@@ -0,0 +1,30 @@
+From 2c2408d815b7cd76a2edd4261eb051e264993090 Mon Sep 17 00:00:00 2001
+From: Amarnath Valluri <amarnath.valluri@intel.com>
+Date: Wed, 5 Aug 2015 16:25:51 +0300
+Subject: [PATCH] dosfstools: Fix memroy leak
+
+Upstream-Status:[Inappropriate]
+
+Avoid leaking memory allocated for buffer.
+
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+ mkdosfs/mkdosfs.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/mkdosfs/mkdosfs.c b/mkdosfs/mkdosfs.c
+index 88b0dc2..2822358 100644
+--- a/mkdosfs/mkdosfs.c
++++ b/mkdosfs/mkdosfs.c
+@@ -1693,6 +1693,8 @@ static int add_file(char *filename, struct dir_entry *dir, unsigned char attr)
+     writebuf(buffer, size, "data");    
+   }
+ 
++  free(buffer);
++
+  exit_add:
+   if (infile) close(infile);
+   return 0;
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb b/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb
index beec488..824c04d 100644
--- a/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb
+++ b/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb
@@ -19,6 +19,7 @@ SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/${BPN}/${BP}.src.tar.gz/407d4
            file://nofat32_autoselect.patch \
            file://fix_populated_dosfs_creation.patch \
 	   file://0001-Include-fcntl.h-for-getting-loff_t-definition.patch \
+           file://dosfstools-Fix-memroy-leak.patch \
 	   "
 
 SRC_URI[md5sum] = "407d405ade410f7597d364ab5dc8c9f6"
-- 
2.1.4

---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-08-09 21:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-06  9:06 [meta-oe][PATCH] dosfstools-2.11: Fix memory leak in mkdosfs Amarnath Valluri
2015-08-06  9:12 ` Alexander Kanavin
2015-08-06  9:25   ` Paul Eggleton
2015-08-06 12:17     ` Valluri, Amarnath
2015-08-07  2:52     ` Khem Raj
2015-08-07  9:51       ` Paul Eggleton
2015-08-07 19:26         ` Khem Raj
2015-08-07 19:54           ` Paul Eggleton
2015-08-08 18:54             ` Khem Raj
2015-08-09 16:21               ` Paul Eggleton
2015-08-09 17:03                 ` Khem Raj
2015-08-09 21:30                   ` Paul Eggleton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.