]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
rx: don't leak a connection hash table in unlikely error condition
authorGarrett Wollman <wollman@csail.mit.edu>
Sun, 15 Jul 2012 19:01:29 +0000 (15:01 -0400)
committerDerrick Brashear <shadow@dementix.org>
Mon, 16 Jul 2012 12:47:30 +0000 (05:47 -0700)
If getsockname() returns an error (which shouldn't be possible),
rx_InitHost would leak a connection hash table (which probably
doesn't matter because the caller will just exit anyway).  Make
the analyzer happy by freeing the memory anyway.

Change-Id: If8e78ebfb787d2dc1c0b9f95f91b6e7510c9e307
Reviewed-on: http://gerrit.openafs.org/7768
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/rx/rx.c

index 03d727031f447f325b6d215900be408d8b44d9d6..8691f96618e3622398971f6eaa41e885eecfc361 100644 (file)
@@ -607,6 +607,7 @@ rx_InitHost(u_int host, u_int port)
 #endif
        if (getsockname((intptr_t)rx_socket, (struct sockaddr *)&addr, &addrlen)) {
            rx_Finalize();
+           osi_Free(htable, rx_hashTableSize * sizeof(struct rx_connection *));
            return -1;
        }
        rx_port = addr.sin_port;