This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

commit 977b99e516cf667b035d9086d85bf17c9ad0f48d
Author: Guillem Jover <[email protected]>
Date:   Wed Dec 3 19:03:18 2014 +0100

    dpkg: Switch from non-freeing malloc to m_malloc on statdb slurping
    
    The individual strings are now nfstrsave()ed so there is no need to
    allocate the whole file in the non-freeing memory pool.
---
 debian/changelog | 1 +
 src/statdb.c     | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 573787c..96373ec 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,7 @@ dpkg (1.18.11) UNRELEASED; urgency=medium
     timestamp from SOURCE_DATE_EPOCH.
   * Generate reproducible file modes for the .deb control member contents.
     Closes: #787980
+  * Switch from non-freeing malloc to m_malloc on statdb slurping.
   * Perl modules:
     - Obsolete Source-Version substvar in Dpkg::Substvars by emitting errors.
     - Rework keyring hooks in Dpkg::Vendor. Deprecate the keyrings hook, and
diff --git a/src/statdb.c b/src/statdb.c
index dcd9128..39d67e4 100644
--- a/src/statdb.c
+++ b/src/statdb.c
@@ -177,7 +177,7 @@ ensure_statoverrides(enum statdb_parse_flags flags)
                return;
        }
 
-       loaded_list = nfmalloc(sb_next.st_size);
+       loaded_list = m_malloc(sb_next.st_size);
        loaded_list_end = loaded_list + sb_next.st_size;
 
        if (fd_read(fileno(file), loaded_list, sb_next.st_size) < 0)
@@ -261,5 +261,7 @@ ensure_statoverrides(enum statdb_parse_flags flags)
                thisline = nextline;
        }
 
+       free(loaded_list);
+
        onerr_abort--;
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/dpkg/dpkg.git

Reply via email to