1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Bug 1082: mem_free_set in abort_preloading

[ From bug 1082 attachment 545.  Added a comment and a NEWS reference.  --KON ]
This commit is contained in:
Witold Filipczyk 2009-07-25 19:09:00 +02:00 committed by Kalle Olavi Niemitalo
parent e943285b84
commit 5bfeb061db
2 changed files with 14 additions and 2 deletions

2
NEWS
View File

@ -22,7 +22,7 @@ Miscellaneous:
document.css.media.
* bug 638: Propagate the existence of $DISPLAY from slave terminals to
mailcap test commands.
* bug 762: Small memory leak in goto_current_link/goto_imgmap
* bugs 762, 1082: Small memory leak in goto_current_link/goto_imgmap
* bug 963: New option document.css.ignore_display_none.
* bug 977: Fixed crash when opening in new tab a non link with onclick
attribute.

View File

@ -55,7 +55,19 @@ free_task(struct session *ses)
void
abort_preloading(struct session *ses, int interrupt)
{
if (!ses->task.type) return;
if (!ses->task.type) {
/* ses->task.target.frame must be freed in the
* destroy_session() => abort_loading() =>
* abort_preloading() call chain. Normally,
* free_task() called from here would do that,
* but if the task has no type, free_task()
* cannot be called because an assertion would
* fail. There are several functions that set
* ses->task.target.frame without ses->task.type,
* so apparently it is allowed. */
mem_free_set(&ses->task.target.frame, NULL);
return;
}
cancel_download(&ses->loading, interrupt);
free_task(ses);