aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archival/dpkg.c3
-rw-r--r--dpkg.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c
index 437b50d3b..a97a5a29f 100644
--- a/archival/dpkg.c
+++ b/archival/dpkg.c
@@ -1042,11 +1042,10 @@ char **create_list(const char *filename)
*last_char = '\0';
}
file_list[count] = xstrdup(line);
- free(line);
count++;
- length = 0;
}
fclose(list_stream);
+ free(line);
if (count == 0) {
return(NULL);
diff --git a/dpkg.c b/dpkg.c
index 437b50d3b..a97a5a29f 100644
--- a/dpkg.c
+++ b/dpkg.c
@@ -1042,11 +1042,10 @@ char **create_list(const char *filename)
*last_char = '\0';
}
file_list[count] = xstrdup(line);
- free(line);
count++;
- length = 0;
}
fclose(list_stream);
+ free(line);
if (count == 0) {
return(NULL);