diff options
-rw-r--r-- | editors/sed.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/editors/sed.c b/editors/sed.c index 8b98a3182..1c016ac57 100644 --- a/editors/sed.c +++ b/editors/sed.c | |||
@@ -1010,17 +1010,15 @@ static void process_file(FILE * file) | |||
1010 | next_line = bb_get_chomped_line_from_file(file); | 1010 | next_line = bb_get_chomped_line_from_file(file); |
1011 | linenum++; | 1011 | linenum++; |
1012 | } else { | 1012 | } else { |
1013 | /* Jump to end of script and exist */ | 1013 | /* Jump to end of script and exit */ |
1014 | deleted = 1; | 1014 | deleted = 1; |
1015 | free(next_line); | ||
1016 | next_line = NULL; | 1015 | next_line = NULL; |
1017 | } | 1016 | } |
1018 | break; | 1017 | break; |
1019 | case 'N': /* Append the next line to the current line */ | 1018 | case 'N': /* Append the next line to the current line */ |
1020 | if (next_line == NULL) { | 1019 | if (next_line == NULL) { |
1021 | /* Jump to end of script and exist */ | 1020 | /* Jump to end of script and exit */ |
1022 | deleted = 1; | 1021 | deleted = 1; |
1023 | free(next_line); | ||
1024 | #ifdef CONFIG_FEATURE_SED_GNU_COMPATABILITY | 1022 | #ifdef CONFIG_FEATURE_SED_GNU_COMPATABILITY |
1025 | /* GNU sed will add the newline character | 1023 | /* GNU sed will add the newline character |
1026 | * The GNU sed info page labels this as a bug that wont be fixed | 1024 | * The GNU sed info page labels this as a bug that wont be fixed |