mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-03 17:54:33 +03:00
Fix double frees on download failure
svn path=/trunk/netsurf/; revision=12621
This commit is contained in:
parent
35cf89594d
commit
b0aeeb1e78
@ -160,7 +160,9 @@ static nserror download_context_process_headers(download_context *ctx)
|
||||
ctx->window = gui_download_window_create(ctx, ctx->parent);
|
||||
if (ctx->window == NULL) {
|
||||
free(ctx->filename);
|
||||
ctx->filename = NULL;
|
||||
lwc_string_unref(ctx->mime_type);
|
||||
ctx->mime_type = NULL;
|
||||
return NSERROR_NOMEM;
|
||||
}
|
||||
|
||||
@ -265,7 +267,8 @@ void download_context_destroy(download_context *ctx)
|
||||
{
|
||||
llcache_handle_release(ctx->llcache);
|
||||
|
||||
lwc_string_unref(ctx->mime_type);
|
||||
if (ctx->mime_type != NULL)
|
||||
lwc_string_unref(ctx->mime_type);
|
||||
|
||||
free(ctx->filename);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user