talloc_steal the packet after reading it
[freeradius.git] / src / main / listen.c
index 37b613b..339e1e6 100644 (file)
@@ -247,6 +247,7 @@ RADCLIENT *client_listener_find(rad_listen_t *listener,
                talloc_free(request);
                goto unknown;
        }
+       (void) talloc_steal(request, request->packet);
        request->reply = rad_alloc_reply(request, request->packet);
        if (!request->reply) {
                talloc_free(request);
@@ -429,7 +430,7 @@ static int dual_tcp_recv(rad_listen_t *listener)
         *      Allocate a packet for partial reads.
         */
        if (!sock->packet) {
-               sock->packet = rad_alloc(sock, 0);
+               sock->packet = rad_alloc(sock, false);
                if (!sock->packet) return 0;
 
                sock->packet->sockfd = listener->fd;