mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-06 05:31:44 +00:00
Merge pull request #132 from xrmx/coverity2a
More issues reported by Coverity
This commit is contained in:
+16
-10
@@ -724,7 +724,7 @@ void uwsgi_manage_command_cron(time_t now) {
|
||||
}
|
||||
}
|
||||
if (current_cron->month < 0) {
|
||||
if ((uwsgi_cron_delta->tm_hour % abs(current_cron->month)) == 0) {
|
||||
if ((uwsgi_cron_delta->tm_mon % abs(current_cron->month)) == 0) {
|
||||
uc_month = uwsgi_cron_delta->tm_mon;
|
||||
}
|
||||
}
|
||||
@@ -1202,6 +1202,7 @@ struct uwsgi_stats *uwsgi_master_generate_stats() {
|
||||
#endif
|
||||
|
||||
#ifdef UWSGI_SSL
|
||||
struct uwsgi_legion *legion = NULL;
|
||||
if (uwsgi.legions) {
|
||||
|
||||
if (uwsgi_stats_comma(us))
|
||||
@@ -1213,7 +1214,7 @@ struct uwsgi_stats *uwsgi_master_generate_stats() {
|
||||
if (uwsgi_stats_list_open(us))
|
||||
goto end;
|
||||
|
||||
struct uwsgi_legion *legion = uwsgi.legions;
|
||||
legion = uwsgi.legions;
|
||||
while (legion) {
|
||||
if (uwsgi_stats_object_open(us))
|
||||
goto end;
|
||||
@@ -1283,30 +1284,30 @@ struct uwsgi_stats *uwsgi_master_generate_stats() {
|
||||
struct uwsgi_legion_node *node = legion->nodes_head;
|
||||
while (node) {
|
||||
if (uwsgi_stats_object_open(us))
|
||||
goto end;
|
||||
goto unlock_legion_mutex;
|
||||
|
||||
if (uwsgi_stats_keyvaln_comma(us, "name", node->name, node->name_len))
|
||||
goto end;
|
||||
goto unlock_legion_mutex;
|
||||
|
||||
if (uwsgi_stats_keyval_comma(us, "uuid", node->uuid))
|
||||
goto end;
|
||||
goto unlock_legion_mutex;
|
||||
|
||||
if (uwsgi_stats_keylong_comma(us, "valor", (unsigned long long) node->valor))
|
||||
goto end;
|
||||
goto unlock_legion_mutex;
|
||||
|
||||
if (uwsgi_stats_keylong_comma(us, "checksum", (unsigned long long) node->checksum))
|
||||
goto end;
|
||||
goto unlock_legion_mutex;
|
||||
|
||||
if (uwsgi_stats_keylong(us, "last_seen", (unsigned long long) node->last_seen))
|
||||
goto end;
|
||||
goto unlock_legion_mutex;
|
||||
|
||||
if (uwsgi_stats_object_close(us))
|
||||
goto end;
|
||||
goto unlock_legion_mutex;
|
||||
|
||||
node = node->next;
|
||||
if (node) {
|
||||
if (uwsgi_stats_comma(us))
|
||||
goto end;
|
||||
goto unlock_legion_mutex;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&legion->lock);
|
||||
@@ -1335,6 +1336,11 @@ struct uwsgi_stats *uwsgi_master_generate_stats() {
|
||||
goto end;
|
||||
|
||||
return us;
|
||||
#ifdef UWSGI_SSL
|
||||
unlock_legion_mutex:
|
||||
if (legion)
|
||||
pthread_mutex_unlock(&legion->lock);
|
||||
#endif
|
||||
end:
|
||||
free(us->base);
|
||||
free(us);
|
||||
|
||||
+3
-1
@@ -997,8 +997,10 @@ int wsgi_req_accept(int queue, struct wsgi_request *wsgi_req) {
|
||||
if (timeout > 0) {
|
||||
uwsgi_heartbeat();
|
||||
// no need to continue if timed-out
|
||||
if (ret == 0)
|
||||
if (ret == 0) {
|
||||
thunder_unlock;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef UWSGI_THREADING
|
||||
|
||||
@@ -201,10 +201,16 @@ void linux_namespace_jail() {
|
||||
|
||||
unmounted = 0;
|
||||
procmounts = fopen("/proc/self/mounts", "r");
|
||||
if (!procmounts)
|
||||
break;
|
||||
while (fgets(line, 1024, procmounts) != NULL) {
|
||||
delim0 = strchr(line, ' ');
|
||||
if (!delim0)
|
||||
continue;
|
||||
delim0++;
|
||||
delim1 = strchr(delim0, ' ');
|
||||
if (!delim1)
|
||||
continue;
|
||||
*delim1 = 0;
|
||||
// and now check for keep-mounts
|
||||
if (uwsgi_is_a_keep_mount(delim0)) continue;
|
||||
|
||||
@@ -107,6 +107,7 @@ int carbon_write(int *fd, char *fmt,...) {
|
||||
int rlen;
|
||||
|
||||
rlen = vsnprintf(ptr, 4096, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (rlen < 1) return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user