소스 검색

dpkg: Refactor match_node deallocation into new match_node_free()

Guillem Jover 15 년 전
부모
커밋
7a79f5a1fa
1개의 변경된 파일9개의 추가작업 그리고 3개의 파일을 삭제
  1. 9 3
      src/processarc.c

+ 9 - 3
src/processarc.c

@@ -172,6 +172,14 @@ struct match_node {
   char *filename;
   char *filename;
 };
 };
 
 
+static void
+match_node_free(struct match_node *node)
+{
+  free(node->filetype);
+  free(node->filename);
+  free(node);
+}
+
 void process_archive(const char *filename) {
 void process_archive(const char *filename) {
   static const struct tar_operations tf = {
   static const struct tar_operations tf = {
     .read = tarfileread,
     .read = tarfileread,
@@ -939,9 +947,7 @@ void process_archive(const char *filename) {
               cidir);
               cidir);
     }
     }
     match_head = match_node->next;
     match_head = match_node->next;
-    free(match_node->filetype);
-    free(match_node->filename);
-    free(match_node);
+    match_node_free(match_node);
   }
   }
 
 
   /* The directory itself. */
   /* The directory itself. */