From: Glenn L McGrath Date: Sat, 22 Sep 2001 03:24:07 +0000 (-0000) Subject: Dont free everytime getline() is used, fix from Stefan Soucek X-Git-Tag: 0_60_2~159 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b8f5adb64f1a9af77c463eef7e31d80def13ef4b;p=platform%2Fupstream%2Fbusybox.git Dont free everytime getline() is used, fix from Stefan Soucek --- diff --git a/archival/dpkg.c b/archival/dpkg.c index 437b50d..a97a5a2 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 437b50d..a97a5a2 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);