]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Free newfd on error
authorAlan T. DeKok <aland@freeradius.org>
Mon, 18 Feb 2013 18:26:54 +0000 (13:26 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 18 Feb 2013 18:31:57 +0000 (13:31 -0500)
src/lib/tcp.c

index 88720b37ac310721eb1124cee08aebaaa3ac68b2..ff79d82618f5970032b214dc2b3a870d9c29c720 100644 (file)
@@ -369,7 +369,10 @@ RADIUS_PACKET *fr_tcp_accept(int sockfd)
        }
                
        packet = rad_alloc(0);
-       if (!packet) return NULL;
+       if (!packet) {
+               close(newfd);
+               return NULL;
+       }
 
        if (src.ss_family == AF_INET) {
                struct sockaddr_in      s4;