The following commit has been merged in the master branch:
commit d2abfdb8bc6137c4a2f87c5c6db22e030d3334c7
Author: Guillem Jover <[email protected]>
Date:   Thu Nov 4 03:38:06 2010 +0100

    dpkg-deb: Use m_realloc instead of m_malloc when the pointer is NULL
    
    This removes a duplicate case which m_realloc will handle just fine.

diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
index 59474b9..703fde5 100644
--- a/dpkg-deb/build.c
+++ b/dpkg-deb/build.c
@@ -130,10 +130,7 @@ getfi(const char *root, int fd)
   struct file_info *fi;
   size_t rl = strlen(root);
 
-  if (fn == NULL) {
-    fnlen = rl + MAXFILENAME;
-    fn = m_malloc(fnlen);
-  } else if (fnlen < (rl + MAXFILENAME)) {
+  if (fnlen < (rl + MAXFILENAME)) {
     fnlen = rl + MAXFILENAME;
     fn = m_realloc(fn, fnlen);
   }

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to