On Thu, 2007-03-22 at 13:01 -0400, Daniel Veillard wrote:
> Index: qemud/iptables.c

        Hmm, this stuff is already in one of the patches I sent.
>  
> -    if (!(argv = (char **)malloc(sizeof(char *) * (n+1))))
> +    if (!(argv = (char **)calloc(1, sizeof(char *) * (n + 1))))

        I'd do:

    if (!(argv = (char **)calloc(n + 1, sizeof(char *))))

        Unless, of course, you're just being ironic about how stupid it is that
we have calloc() rather than malloc0() ... in which case I thoroughly
approve :-)

        Same thing elsewhere in the patch e.g.

> -    if (!(*argv = malloc(len * sizeof(char *))))
> +    if (!(*argv = calloc(1, len * sizeof(char *))))

        should be:

    if (!(*argv = calloc(len, sizeof(char *))))

Cheers,
Mark.

--
Libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to