Skip to content

fix use-after-free in earlier patch

Inadvertently added a use-after-free due to incomplete work in commit b0220259.

Reworked more substantially to deal with two cases in cgi_server_name():

  1. getenv() returning pre-allocated pointers to environment
  2. uname() requiring a memory allocation

Changed the method of returning the value so that a non-NULL value is a pointer to a heap allocation the caller must free after using it.

Also made sure time.h is included in the header file to quiet declaration warnings.

Merge request reports

Loading