diff options
Diffstat (limited to 'editors')
-rw-r--r-- | editors/sed.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/editors/sed.c b/editors/sed.c index bf8a11613..fd56e0e7f 100644 --- a/editors/sed.c +++ b/editors/sed.c | |||
@@ -186,18 +186,23 @@ static void sed_free_and_close_stuff(void) | |||
186 | if (sed_cmd->sw_file) | 186 | if (sed_cmd->sw_file) |
187 | fclose(sed_cmd->sw_file); | 187 | fclose(sed_cmd->sw_file); |
188 | 188 | ||
189 | if (sed_cmd->beg_match) { | 189 | /* Used to free regexps, but now there is code |
190 | regfree(sed_cmd->beg_match); | 190 | * in get_address() which can reuse a regexp |
191 | free(sed_cmd->beg_match); | 191 | * for constructs as /regexp/cmd1;//cmd2 |
192 | } | 192 | * leading to double-frees here: |
193 | if (sed_cmd->end_match) { | 193 | */ |
194 | regfree(sed_cmd->end_match); | 194 | //if (sed_cmd->beg_match) { |
195 | free(sed_cmd->end_match); | 195 | // regfree(sed_cmd->beg_match); |
196 | } | 196 | // free(sed_cmd->beg_match); |
197 | if (sed_cmd->sub_match) { | 197 | //} |
198 | regfree(sed_cmd->sub_match); | 198 | //if (sed_cmd->end_match) { |
199 | free(sed_cmd->sub_match); | 199 | // regfree(sed_cmd->end_match); |
200 | } | 200 | // free(sed_cmd->end_match); |
201 | //} | ||
202 | //if (sed_cmd->sub_match) { | ||
203 | // regfree(sed_cmd->sub_match); | ||
204 | // free(sed_cmd->sub_match); | ||
205 | //} | ||
201 | free(sed_cmd->string); | 206 | free(sed_cmd->string); |
202 | free(sed_cmd); | 207 | free(sed_cmd); |
203 | sed_cmd = sed_cmd_next; | 208 | sed_cmd = sed_cmd_next; |