aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2001-09-22 03:24:07 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2001-09-22 03:24:07 +0000
commitb8f5adb64f1a9af77c463eef7e31d80def13ef4b (patch)
tree8c2b6209182e2a32cb87613de20be3bbca9a65c3
parent3be34309e3274cd6996e4257dd3df7307c8dee3d (diff)
downloadbusybox-w32-b8f5adb64f1a9af77c463eef7e31d80def13ef4b.tar.gz
busybox-w32-b8f5adb64f1a9af77c463eef7e31d80def13ef4b.tar.bz2
busybox-w32-b8f5adb64f1a9af77c463eef7e31d80def13ef4b.zip
Dont free everytime getline() is used, fix from Stefan Soucek
-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)
1042 *last_char = '\0'; 1042 *last_char = '\0';
1043 } 1043 }
1044 file_list[count] = xstrdup(line); 1044 file_list[count] = xstrdup(line);
1045 free(line);
1046 count++; 1045 count++;
1047 length = 0;
1048 } 1046 }
1049 fclose(list_stream); 1047 fclose(list_stream);
1048 free(line);
1050 1049
1051 if (count == 0) { 1050 if (count == 0) {
1052 return(NULL); 1051 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)
1042 *last_char = '\0'; 1042 *last_char = '\0';
1043 } 1043 }
1044 file_list[count] = xstrdup(line); 1044 file_list[count] = xstrdup(line);
1045 free(line);
1046 count++; 1045 count++;
1047 length = 0;
1048 } 1046 }
1049 fclose(list_stream); 1047 fclose(list_stream);
1048 free(line);
1050 1049
1051 if (count == 0) { 1050 if (count == 0) {
1052 return(NULL); 1051 return(NULL);