All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amarnath Valluri <amarnath.valluri@intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [meta-oe][PATCH] dosfstools-2.11: Fix memory leak in mkdosfs
Date: Thu,  6 Aug 2015 12:06:09 +0300	[thread overview]
Message-ID: <1438851969-4340-1-git-send-email-amarnath.valluri@intel.com> (raw)

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.



             reply	other threads:[~2015-08-06  9:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06  9:06 Amarnath Valluri [this message]
2015-08-06  9:12 ` [meta-oe][PATCH] dosfstools-2.11: Fix memory leak in mkdosfs 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438851969-4340-1-git-send-email-amarnath.valluri@intel.com \
    --to=amarnath.valluri@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.