Fix bug #3398114: only unref filename_value if we successfully obtained it

svn path=/trunk/netsurf/; revision=12670
This commit is contained in:
John Mark Bell 2011-08-25 19:21:09 +00:00
parent 0794f8c4dd
commit 5f311d08ef
1 changed files with 3 additions and 2 deletions

View File

@ -132,12 +132,13 @@ static nserror download_context_process_headers(download_context *ctx)
error = http_parameter_list_find_item(disposition->parameters,
filename, &filename_value);
if (error == NSERROR_OK)
if (error == NSERROR_OK) {
ctx->filename = download_parse_filename(
lwc_string_data(filename_value));
lwc_string_unref(filename_value);
}
http_content_disposition_destroy(disposition);
lwc_string_unref(filename_value);
lwc_string_unref(filename);
}