]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix for same memory leak in cos_socket_recv
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 16 Jun 2015 03:01:59 +0000 (23:01 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 16 Jun 2015 03:02:05 +0000 (23:02 -0400)
src/main/listen.c

index f739cd47773e855ded4bc3cfd49a4cfbbd815033..512285463e6152cb0b113ef15d94694d30f6d821 100644 (file)
@@ -1567,9 +1567,9 @@ static int auth_socket_recv(rad_listen_t *listener)
         */
        packet = rad_recv(ctx, listener->fd, client->message_authenticator);
        if (!packet) {
-               talloc_free(ctx);
                FR_STATS_INC(auth, total_malformed_requests);
                if (DEBUG_ENABLED) ERROR("Receive - %s", fr_strerror());
+               talloc_free(ctx);
                return 0;
        }
 
@@ -1955,12 +1955,14 @@ static int coa_socket_recv(rad_listen_t *listener)
        if (!packet) {
                FR_STATS_INC(coa, total_malformed_requests);
                ERROR("Receive - %s", fr_strerror());
+               talloc_free(ctx);
                return 0;
        }
 
        if (!request_receive(ctx, listener, packet, client, fun)) {
                FR_STATS_INC(coa, total_packets_dropped);
                rad_free(&packet);
+               talloc_free(ctx);
                return 0;
        }