Skip to content

Commit

Permalink
Check against malloc failure in proxy_config_env_get_proxy.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmoinvaz committed Feb 21, 2023
1 parent 7a7bcc4 commit a638f8c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config_env.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ char *proxy_config_env_get_proxy(const char *scheme) {
// Construct name of environment variable based on proxy scheme
size_t name_len = strlen(scheme) + 8;
char *name = (char *)malloc(name_len);
if (!name)
return NULL;
snprintf(name, name_len, "%s_proxy", scheme);

// Don't check HTTP_PROXY due to CGI environment variable creation
Expand Down

0 comments on commit a638f8c

Please sign in to comment.