Jim Meyering wrote:

>>From 3fa79efb8e67aa460c5a5d4e4c9132624df8a040 Mon Sep 17 00:00:00 2001
> From: Jim Meyering <[email protected]>
> Date: Mon, 6 Apr 2009 20:11:37 +0200
> Subject: [PATCH] sq.h: const'ify, and avoid NULL-deref
>
> * include/corosync/sq.h (sq_init): Avoid NULL-deref on malloc failure.
> ---
>  include/corosync/sq.h |   27 +++++++++++++++------------
...
> -     sq->items_inuse = (void *)malloc (item_count * sizeof (unsigned int));
> +     if ((sq->items_inuse = malloc (item_count * sizeof (unsigned int)))
> +         != NULL) {
> +             return (-ENOMEM);
> +     }

That should be testing "== NULL", of course.
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to