diff options
author | Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com> | 2015-09-11 14:53:09 -0700 |
---|---|---|
committer | Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com> | 2015-09-11 18:08:08 -0700 |
commit | 9a168e9371d6fbd69c9a88d5573a5ade095efaaf (patch) | |
tree | d0e907ed165c69cbff8cffa3319a607d1470f1f9 /ffserver.c | |
parent | 4b66274a86ddcabf15c51e45ebd6f144387130a6 (diff) | |
download | ffmpeg-9a168e9371d6fbd69c9a88d5573a5ade095efaaf.tar.gz |
ffserver: unify fail path in socket_open_listen()
Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Diffstat (limited to 'ffserver.c')
-rw-r--r-- | ffserver.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ffserver.c b/ffserver.c index 8b6e441513..2a5bc92d5d 100644 --- a/ffserver.c +++ b/ffserver.c @@ -470,20 +470,22 @@ static int socket_open_listen(struct sockaddr_in *my_addr) snprintf(bindmsg, sizeof(bindmsg), "bind(port %d)", ntohs(my_addr->sin_port)); perror (bindmsg); - closesocket(server_fd); - return -1; + goto fail; } if (listen (server_fd, 5) < 0) { perror ("listen"); - closesocket(server_fd); - return -1; + goto fail; } if (ff_socket_nonblock(server_fd, 1) < 0) av_log(NULL, AV_LOG_WARNING, "ff_socket_nonblock failed\n"); return server_fd; + +fail: + closesocket(server_fd); + return -1; } /* start all multicast streams */ |