diff -up stunnel-5.48/src/file.c.coverity stunnel-5.48/src/file.c --- stunnel-5.48/src/file.c.coverity 2018-04-06 16:25:10.000000000 +0200 +++ stunnel-5.48/src/file.c 2018-09-04 17:24:08.948928882 +0200 @@ -120,7 +120,7 @@ DISK_FILE *file_open(char *name, FILE_MO return NULL; /* setup df structure */ - df=str_alloc(sizeof df); + df=str_alloc(sizeof *df); df->fd=fd; return df; } diff -up stunnel-5.48/src/options.c.coverity stunnel-5.48/src/options.c --- stunnel-5.48/src/options.c.coverity 2018-09-04 17:24:08.946928836 +0200 +++ stunnel-5.48/src/options.c 2018-09-04 18:47:03.135083884 +0200 @@ -515,8 +515,7 @@ NOEXPORT int options_include(char *direc "%s/%s", #endif directory, namelist[i]->d_name); - stat(name, &sb); - if(S_ISREG(sb.st_mode)) + if(stat(name, &sb) == 0 && S_ISREG(sb.st_mode)) err=options_file(name, CONF_FILE, section); else s_log(LOG_DEBUG, "\"%s\" is not a file", name); @@ -3773,6 +3772,7 @@ NOEXPORT PSK_KEYS *psk_dup(PSK_KEYS *src else head=curr; tail=curr; + src=src->next; } return head; } diff -up stunnel-5.48/src/str.c.coverity stunnel-5.48/src/str.c --- stunnel-5.48/src/str.c.coverity 2018-07-02 23:30:10.000000000 +0200 +++ stunnel-5.48/src/str.c 2018-09-04 17:24:08.949928906 +0200 @@ -165,6 +165,7 @@ char *str_vprintf(const char *format, va for(;;) { va_copy(ap, start_ap); n=vsnprintf(p, size, format, ap); + va_end(ap); if(n>-1 && n<(int)size) return p; if(n>-1) /* glibc 2.1 */ diff -up stunnel-5.48/src/stunnel.c.coverity stunnel-5.48/src/stunnel.c --- stunnel-5.48/src/stunnel.c.coverity 2018-07-02 23:30:10.000000000 +0200 +++ stunnel-5.48/src/stunnel.c 2018-09-04 17:24:08.949928906 +0200 @@ -364,7 +364,6 @@ NOEXPORT int accept_connection(SERVICE_O #endif if(create_client(fd, s, alloc_client_session(opt, s, s))) { s_log(LOG_ERR, "Connection rejected: create_client failed"); - closesocket(s); #ifndef USE_FORK service_free(opt); #endif