瀏覽代碼

dpkg: Use m_realloc() instead of free()+m_malloc() on process_archive()

Guillem Jover 15 年之前
父節點
當前提交
efa6e49193
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. 1 3
      src/processarc.c

+ 1 - 3
src/processarc.c

@@ -224,9 +224,7 @@ void process_archive(const char *filename) {
     if (!tmpdir)
     if (!tmpdir)
       ohshite(_("unable to create temporary directory"));
       ohshite(_("unable to create temporary directory"));
 
 
-    if (!cidir)
-      free(cidir);
-    cidir = m_malloc(strlen(tmpdir) + MAXCONTROLFILENAME + 10);
+    cidir = m_realloc(cidir, strlen(tmpdir) + MAXCONTROLFILENAME + 10);
     strcpy(cidir, tmpdir);
     strcpy(cidir, tmpdir);
     strcat(cidir,"/");
     strcat(cidir,"/");