]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix memory leak on malformed or duplicate accounting requests
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 16 Jun 2015 01:06:40 +0000 (21:06 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 16 Jun 2015 01:06:40 +0000 (21:06 -0400)
src/main/listen.c

index 52db4219987ce75d0d590436ba2b59e5184af895..f739cd47773e855ded4bc3cfd49a4cfbbd815033 100644 (file)
@@ -1686,6 +1686,7 @@ static int acct_socket_recv(rad_listen_t *listener)
        if (!packet) {
                FR_STATS_INC(acct, total_malformed_requests);
                ERROR("Receive - %s", fr_strerror());
+               talloc_free(ctx);
                return 0;
        }
 
@@ -1695,6 +1696,7 @@ static int acct_socket_recv(rad_listen_t *listener)
        if (!request_receive(ctx, listener, packet, client, fun)) {
                FR_STATS_INC(acct, total_packets_dropped);
                rad_free(&packet);
+               talloc_free(ctx);
                return 0;
        }