Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ void uwsgi_manage_exception(struct wsgi_request *wsgi_req,int catch) {
uwsgi.workers[uwsgi.mywid].cores[wsgi_req->async_id].exceptions++;
uwsgi_apps[wsgi_req->app_id].exceptions++;

if (uwsgi.reload_on_exception_type && uwsgi.p[wsgi_req->uh->modifier1]->exception_class) {
if (uwsgi.reload_on_exception_type && uwsgi.p[wsgi_req->uh->modifier1]->exception_class && uwsgi.p[wsgi_req->uh->modifier1]->exception_msg) {
struct uwsgi_buffer *ub = uwsgi.p[wsgi_req->uh->modifier1]->exception_msg(wsgi_req);
if (ub) {
struct uwsgi_string_list *usl = uwsgi.reload_on_exception_type;
Expand Down Expand Up @@ -365,7 +365,7 @@ void uwsgi_manage_exception(struct wsgi_request *wsgi_req,int catch) {
}
}

if (uwsgi.reload_on_exception_repr && uwsgi.p[wsgi_req->uh->modifier1]->exception_repr) {
if (uwsgi.reload_on_exception_repr && uwsgi.p[wsgi_req->uh->modifier1]->exception_repr && uwsgi.p[wsgi_req->uh->modifier1]->exception_msg) {
struct uwsgi_buffer *ub = uwsgi.p[wsgi_req->uh->modifier1]->exception_msg(wsgi_req);
if (ub) {
struct uwsgi_string_list *usl = uwsgi.reload_on_exception_repr;
Expand Down
3 changes: 2 additions & 1 deletion core/websockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ static struct uwsgi_buffer *uwsgi_websockets_parse(struct wsgi_request *wsgi_req
uwsgi_buffer_append(ub, "\0", 1);
return ub;
error:
uwsgi_buffer_destroy(ub);
if (ub)
uwsgi_buffer_destroy(ub);
if (uwsgi.websockets_continuation_buffer != NULL && ub != uwsgi.websockets_continuation_buffer) {
uwsgi_buffer_destroy(uwsgi.websockets_continuation_buffer);
}
Expand Down
18 changes: 16 additions & 2 deletions core/xmlconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,11 @@ static void textElement(void *xml_id, const char *s, int len) {
if (!uwsgi_xml_found_stanza)
return;
if (uwsgi_xml_found_opt_key) {
add_exported_option(strdup(uwsgi_xml_found_opt_key), uwsgi_concat2n((char *) s, len, (char *) "", 0), 0);
char *opt_key_dup = strdup(uwsgi_xml_found_opt_key);
if (!opt_key_dup)
return;

add_exported_option(opt_key_dup, uwsgi_concat2n((char *) s, len, (char *) "", 0), 0);
uwsgi_xml_found_opt_key = NULL;
}
}
Expand All @@ -216,7 +220,17 @@ static void endElement(void *xml_id, const XML_Char * name) {
if (!uwsgi_xml_found_opt_key)
return;

add_exported_option(strdup(uwsgi_xml_found_opt_key), strdup("1"), 0);
char *opt_key_dup = strdup(uwsgi_xml_found_opt_key);
if (!opt_key_dup)
return;

char *value_dup = strdup("1");
if (!value_dup) {
free(opt_key_dup);
return;
}

add_exported_option(opt_key_dup, value_dup, 0);
uwsgi_xml_found_opt_key = NULL;
}

Expand Down