Merge pull request #518 from xrmx/coverity0802

Some coverity fixes
This commit is contained in:
unbit
2014-02-08 13:56:36 +01:00
3 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -374,12 +374,12 @@ char *uwsgi_spool_request(struct wsgi_request *wsgi_req, char *buf, size_t len,
clear:
if (filename) free(filename);
uwsgi_unlock(uspool->lock);
uwsgi_error("uwsgi_spool_request()/write()");
if (unlink(filename)) {
uwsgi_error("uwsgi_spool_request()/unlink()");
}
free(filename);
// unlock the file too
close(fd);
return NULL;
+5
View File
@@ -181,6 +181,7 @@ char *uwsgi_write_pem_to_file(char *name, char *buf, size_t len, char *ext) {
uwsgi_log("unable to write pem data in file %s\n", filename);
uwsgi_error("uwsgi_write_pem_to_file()/write()");
free(filename);
close(fd);
return NULL;
}
@@ -304,6 +305,10 @@ SSL_CTX *uwsgi_ssl_new_server_context(char *name, char *crt, char *key, char *ci
SSL_CTX_set_verify_depth(ctx, 1);
if (uwsgi.ssl_tmp_dir && !uwsgi_starts_with(client_ca, strlen(client_ca), "-----BEGIN ", 11)) {
if (!name) {
SSL_CTX_free(ctx);
return NULL;
}
client_ca = uwsgi_write_pem_to_file(name, client_ca, strlen(client_ca), ".ca");
if (!client_ca) {
SSL_CTX_free(ctx);
+4
View File
@@ -29,6 +29,10 @@ static ssize_t uwsgi_pipe_logger(struct uwsgi_logger *ul, char *message, size_t
else {
// child
setsid();
if (setsid() < 0) {
uwsgi_error("setsid()");
exit(1);
}
close(pipefd[1]);
dup2(pipefd[0], STDIN_FILENO);
close(pipefd[0]);