summaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorAzat Khuzhin <azat@libevent.org>2020-06-25 09:08:31 +0300
committerAzat Khuzhin <azat@libevent.org>2020-06-25 09:41:54 +0300
commit4528d8e98781be794cbce13394f8442dd466684b (patch)
treec36a6a515199e3c8c7005fac0a4a2bfb9ddf2cb9 /http.c
parent45c3fc29fb2240dbaa066c971f3fd59861293305 (diff)
downloadlibevent-4528d8e98781be794cbce13394f8442dd466684b.tar.gz
Check error code of evhttp_add_header_internal() in evhttp_parse_query_impl()
Diffstat (limited to 'http.c')
-rw-r--r--http.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/http.c b/http.c
index e8f78826..abd255dc 100644
--- a/http.c
+++ b/http.c
@@ -3524,6 +3524,7 @@ evhttp_parse_query_impl(const char *str, struct evkeyvalq *headers,
p = argument = line;
while (p != NULL && *p != '\0') {
char *key, *value, *decoded_value;
+ int err;
argument = strsep(&p, "&");
value = argument;
@@ -3547,8 +3548,10 @@ evhttp_parse_query_impl(const char *str, struct evkeyvalq *headers,
event_debug(("Query Param: %s -> %s\n", key, decoded_value));
if (flags & EVHTTP_URI_QUERY_LAST_VAL)
evhttp_remove_header(headers, key);
- evhttp_add_header_internal(headers, key, decoded_value);
+ err = evhttp_add_header_internal(headers, key, decoded_value);
mm_free(decoded_value);
+ if (err)
+ goto error;
}
result = 0;