core: check return of uwsgi_connect in uwsgi_opt_connect_and_read

Reported by Coverity as CID #970995.
This commit is contained in:
Riccardo Magliocchetti
2013-01-26 21:18:55 +01:00
parent 838bdd27a6
commit 297bd429a9
+3 -1
View File
@@ -4035,7 +4035,7 @@ void uwsgi_opt_connect_and_read(char *opt, char *address, void *foobar) {
char buf[8192];
int fd = uwsgi_connect(address, -1, 0);
for (;;) {
while (fd >= 0) {
int ret = uwsgi_waitfd(fd, -1);
if (ret <= 0) {
exit(0);
@@ -4046,6 +4046,8 @@ void uwsgi_opt_connect_and_read(char *opt, char *address, void *foobar) {
}
uwsgi_log("%.*s", (int) len, buf);
}
uwsgi_error("uwsgi_connect()");
exit(1);
}
void uwsgi_opt_extract(char *opt, char *address, void *foobar) {