rts: Fix potential memory leak in ProfHeap.c

Discovered by Coverity. CID 43166.

Signed-off-by: Austin Seipp <austin@well-typed.com>
rts: Fix possible int overflow in resize_nursery

n_capabilities is declared as unsigned int (32bit), and so multiplication
is 32-bit before being stored in a 64bit integer (StgWord).

Instead, cast n_capabilities to StgWord before multiplying.

Discovered by Coverity. CID 43164.

Signed-off-by: Austin Seipp <austin@well-typed.com>
coverity: Suppress some time-of-check-time-of-use reports

CID 43178

Signed-off-by: Austin Seipp <austin@well-typed.com>
Check return value of sigaction

Issue discovered by Coverity scan, CID 43142.

Signed-off-by: Austin Seipp <austin@well-typed.com>
Fix potential out-of-bound memory access

Issue discovered by Coverity scan, CID 43165.

Signed-off-by: Austin Seipp <austin@well-typed.com>
Check correct variable for NULL

Issue discovered by Coverity scan, CID 43163. This should fix CID 43172 as a
side-effect as well.

Signed-off-by: Austin Seipp <austin@well-typed.com>
Fix memleak in hp2ps

Issue discovered by Coverity scan, CID 43167.

Signed-off-by: Austin Seipp <austin@well-typed.com>