Przeglądaj źródła

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.
Guillem Jover 15 lat temu
rodzic
commit
d2abfdb8bc
1 zmienionych plików z 1 dodań i 4 usunięć
  1. 1 4
      dpkg-deb/build.c

+ 1 - 4
dpkg-deb/build.c

@@ -130,10 +130,7 @@ getfi(const char *root, int fd)
   struct file_info *fi;
   struct file_info *fi;
   size_t rl = strlen(root);
   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;
     fnlen = rl + MAXFILENAME;
     fn = m_realloc(fn, fnlen);
     fn = m_realloc(fn, fnlen);
   }
   }