summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-08-25 19:21:09 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2011-08-25 19:21:09 +0000
commit5f311d08ef77b809a6319caab1a83a932af2bc63 (patch)
treef5adf65c85f04d3fafc84487fc8302c7e3c59fbb
parent0794f8c4dd00b9ca99e1a6a6db29067f619fc9dc (diff)
downloadnetsurf-5f311d08ef77b809a6319caab1a83a932af2bc63.tar.gz
netsurf-5f311d08ef77b809a6319caab1a83a932af2bc63.tar.bz2
Fix bug #3398114: only unref filename_value if we successfully obtained it
svn path=/trunk/netsurf/; revision=12670
-rw-r--r--desktop/download.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/desktop/download.c b/desktop/download.c
index 71aa55e67..b0ca700d0 100644
--- a/desktop/download.c
+++ b/desktop/download.c
@@ -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);
}