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

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

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

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

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

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

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

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

ffserver.c:462:5: 
  460.     }
  461. 
  462.     tmp = 1;
           ^
  463.     setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR, &tmp, sizeof(tmp));
  464. 

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

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

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

ffserver.c:478:5: 
  476.         return -1;
  477.     }
  478.     ff_socket_nonblock(server_fd, 1);
           ^
  479. 
  480.     return server_fd;

libavformat/os_support.c:72:1: start of procedure ff_socket_nonblock()
    70. }
    71. 
    72. int ff_socket_nonblock(int socket, int enable)
        ^
    73. {
    74. #ifdef HAVE_WINSOCK2_H

libavformat/os_support.c:77:8: Taking true branch
    75.    return ioctlsocket(socket, FIONBIO, &enable);
    76. #else
    77.    if (enable)
               ^
    78.       return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) | O_NONBLOCK);
    79.    else

libavformat/os_support.c:78:7: 
    76. #else
    77.    if (enable)
    78.       return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) | O_NONBLOCK);
              ^
    79.    else
    80.       return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) & ~O_NONBLOCK);

libavformat/os_support.c:82:1: return from a call to ff_socket_nonblock
    80.       return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) & ~O_NONBLOCK);
    81. #endif
    82. }
        ^
    83. #endif /* CONFIG_NETWORK */
    84. 

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

ffserver.c:481:1: return from a call to socket_open_listen
  479. 
  480.     return server_fd;
  481. }
       ^
  482. 
  483. /* start all multicast streams */

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

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

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

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

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

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

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

ffserver.c:459:9: 
  457.     if (server_fd < 0) {
  458.         perror ("socket");
  459.         return -1;
               ^
  460.     }
  461. 

ffserver.c:481:1: return from a call to socket_open_listen
  479. 
  480.     return server_fd;
  481. }
       ^
  482. 
  483. /* start all multicast streams */

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

ffserver.c:555:13: 
553.         rtsp_server_fd = socket_open_listen(&my_rtsp_addr);
554.         if (rtsp_server_fd < 0)
555.             return -1;
                 ^
556.     }
557. 
