diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2014-08-15 09:41:37 +0200 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2014-08-15 09:41:37 +0200 |
| commit | 8c1b7e8aa49fd2d59bee5d3e4b6766a81ec847a2 (patch) | |
| tree | ca40b94780b10b8a37222ea0b5c5e089463e5487 /fcgiwrap.c | |
| parent | 4327b4162ca79a98fce7fcf82f138c7a86758780 (diff) | |
Use-after-free fix
Diffstat (limited to 'fcgiwrap.c')
| -rw-r--r-- | fcgiwrap.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -853,7 +853,6 @@ int main(int argc, char **argv) if (setup_socket(socket_url, &fd) < 0) { return 1; } - free(socket_url); } prefork(nchildren); @@ -863,9 +862,12 @@ int main(int argc, char **argv) const char *p = socket_url; close(fd); - if (!strncmp(p, "unix:", sizeof("unix:") - 1)) { - p += sizeof("unix:") - 1; - unlink(p); + if(socket_url) { + if (!strncmp(p, "unix:", sizeof("unix:") - 1)) { + p += sizeof("unix:") - 1; + unlink(p); + } + free(socket_url); } } return 0; |
