ffserver.c:558: error: Resource Leak
  resource acquired to `return` by call to `socket_open_listen()` at line 550, column 21 is not released after line 558, column 13.

ffserver.c:542:1: start of procedure http_server()
540. 
541. /* main loop of the http server */
542. static int http_server(void)
     ^
543. {
544.     int server_fd = 0, rtsp_server_fd = 0;

ffserver.c:544:5: 
542. static int http_server(void)
543. {
544.     int server_fd = 0, rtsp_server_fd = 0;
         ^
545.     int ret, delay, delay1;
546.     struct pollfd poll_table[HTTP_MAX_CONNECTIONS + 2], *poll_entry;

ffserver.c:549:9: Taking true branch
547.     HTTPContext *c, *c_next;
548. 
549.     if (my_http_addr.sin_port) {
             ^
550.         server_fd = socket_open_listen(&my_http_addr);
551.         if (server_fd < 0)

ffserver.c:550:9: 
548. 
549.     if (my_http_addr.sin_port) {
550.         server_fd = socket_open_listen(&my_http_addr);
             ^
551.         if (server_fd < 0)
552.             return -1;

ffserver.c:455:1: start of procedure socket_open_listen()
  453. 
  454. /* open a listening socket */
  455. static int socket_open_listen(struct sockaddr_in *my_addr)
       ^
  456. {
  457.     int server_fd, tmp;

ffserver.c:459:5: 
  457.     int server_fd, tmp;
  458. 
  459.     server_fd = socket(AF_INET,SOCK_STREAM,0);
           ^
  460.     if (server_fd < 0) {
  461.         perror ("socket");

ffserver.c:460:9: Taking false branch
  458. 
  459.     server_fd = socket(AF_INET,SOCK_STREAM,0);
  460.     if (server_fd < 0) {
               ^
  461.         perror ("socket");
  462.         return -1;

ffserver.c:465:5: 
  463.     }
  464. 
  465.     tmp = 1;
           ^
  466.     setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR, &tmp, sizeof(tmp));
  467. 

ffserver.c:466:5: Skipping setsockopt(): method has no implementation
  464. 
  465.     tmp = 1;
  466.     setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR, &tmp, sizeof(tmp));
           ^
  467. 
  468.     if (bind (server_fd, (struct sockaddr *) my_addr, sizeof (*my_addr)) < 0) {

ffserver.c:468:9: Taking false branch
  466.     setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR, &tmp, sizeof(tmp));
  467. 
  468.     if (bind (server_fd, (struct sockaddr *) my_addr, sizeof (*my_addr)) < 0) {
               ^
  469.         char bindmsg[32];
  470.         snprintf(bindmsg, sizeof(bindmsg), "bind(port %d)", ntohs(my_addr->sin_port));

ffserver.c:476:9: Taking false branch
  474.     }
  475. 
  476.     if (listen (server_fd, 5) < 0) {
               ^
  477.         perror ("listen");
  478.         closesocket(server_fd);

ffserver.c:481:5: 
  479.         return -1;
  480.     }
  481.     ff_socket_nonblock(server_fd, 1);
           ^
  482. 
  483.     return server_fd;

libavformat/os_support.c:77:1: start of procedure ff_socket_nonblock()
    75. }
    76. 
    77. int ff_socket_nonblock(int socket, int enable)
        ^
    78. {
    79. #ifdef HAVE_WINSOCK2_H

libavformat/os_support.c:82:8: Taking true branch
    80.    return ioctlsocket(socket, FIONBIO, &enable);
    81. #else
    82.    if (enable)
               ^
    83.       return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) | O_NONBLOCK);
    84.    else

libavformat/os_support.c:83:7: 
    81. #else
    82.    if (enable)
    83.       return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) | O_NONBLOCK);
              ^
    84.    else
    85.       return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) & ~O_NONBLOCK);

libavformat/os_support.c:87:1: return from a call to ff_socket_nonblock
    85.       return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) & ~O_NONBLOCK);
    86. #endif
    87. }
        ^
    88. #endif /* CONFIG_NETWORK */
    89. 

ffserver.c:483:5: 
  481.     ff_socket_nonblock(server_fd, 1);
  482. 
  483.     return server_fd;
           ^
  484. }
  485. 

ffserver.c:484:1: return from a call to socket_open_listen
  482. 
  483.     return server_fd;
  484. }
       ^
  485. 
  486. /* start all multicast streams */

ffserver.c:551:13: Taking false branch
549.     if (my_http_addr.sin_port) {
550.         server_fd = socket_open_listen(&my_http_addr);
551.         if (server_fd < 0)
                 ^
552.             return -1;
553.     }

ffserver.c:555:9: Taking true branch
553.     }
554. 
555.     if (my_rtsp_addr.sin_port) {
             ^
556.         rtsp_server_fd = socket_open_listen(&my_rtsp_addr);
557.         if (rtsp_server_fd < 0)

ffserver.c:556:9: 
554. 
555.     if (my_rtsp_addr.sin_port) {
556.         rtsp_server_fd = socket_open_listen(&my_rtsp_addr);
             ^
557.         if (rtsp_server_fd < 0)
558.             return -1;

ffserver.c:455:1: start of procedure socket_open_listen()
  453. 
  454. /* open a listening socket */
  455. static int socket_open_listen(struct sockaddr_in *my_addr)
       ^
  456. {
  457.     int server_fd, tmp;

ffserver.c:459:5: 
  457.     int server_fd, tmp;
  458. 
  459.     server_fd = socket(AF_INET,SOCK_STREAM,0);
           ^
  460.     if (server_fd < 0) {
  461.         perror ("socket");

ffserver.c:460:9: Taking true branch
  458. 
  459.     server_fd = socket(AF_INET,SOCK_STREAM,0);
  460.     if (server_fd < 0) {
               ^
  461.         perror ("socket");
  462.         return -1;

ffserver.c:461:9: 
  459.     server_fd = socket(AF_INET,SOCK_STREAM,0);
  460.     if (server_fd < 0) {
  461.         perror ("socket");
               ^
  462.         return -1;
  463.     }

ffserver.c:462:9: 
  460.     if (server_fd < 0) {
  461.         perror ("socket");
  462.         return -1;
               ^
  463.     }
  464. 

ffserver.c:484:1: return from a call to socket_open_listen
  482. 
  483.     return server_fd;
  484. }
       ^
  485. 
  486. /* start all multicast streams */

ffserver.c:557:13: Taking true branch
555.     if (my_rtsp_addr.sin_port) {
556.         rtsp_server_fd = socket_open_listen(&my_rtsp_addr);
557.         if (rtsp_server_fd < 0)
                 ^
558.             return -1;
559.     }

ffserver.c:558:13: 
556.         rtsp_server_fd = socket_open_listen(&my_rtsp_addr);
557.         if (rtsp_server_fd < 0)
558.             return -1;
                 ^
559.     }
560. 
