From: Mathieu Desnoyers Date: Fri, 4 Sep 2015 05:35:47 +0000 (-0400) Subject: Fix: elf: NULL pointer dereference X-Git-Tag: v2.8.0-rc1~87 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5ada26b49f63b2c4f9e4e01aba69f9fb9e935c4f;p=lttng-ust.git Fix: elf: NULL pointer dereference Coverity reported: CID 1321730 (#1 of 1): Dereference null return value (NULL_RETURNS)15. dereference: Dereferencing a pointer that might be null _build_id when calling lttng_ust_read. Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust/lttng-ust-elf.c b/liblttng-ust/lttng-ust-elf.c index ee7eb7c4..dd50f2b6 100644 --- a/liblttng-ust/lttng-ust-elf.c +++ b/liblttng-ust/lttng-ust-elf.c @@ -452,7 +452,7 @@ int lttng_ust_elf_get_build_id_from_segment( _length = nhdr.n_descsz; _build_id = zmalloc(sizeof(uint8_t) * _length); - if (!build_id) { + if (!_build_id) { goto error; }