Small memory leak in sound system

Hans Petter Selasky hselasky at
Fri Jun 16 14:14:48 UTC 2006


I think I have found a memory leak, but I am not completely sure.

Several drivers allocate the following structure, "struct sndcard_func", but 
never free it. Also "uaudio". Is this correct, or have I missed something?

        /* PCM Audio */
        func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT);
        if (func == NULL)
                return (ENOMEM);
        bzero(func, sizeof(*func));
        func->func = SCF_PCM;
        child = device_add_child(dev, "pcm", -1);
        device_set_ivars(child, func);



More information about the freebsd-multimedia mailing list