Check the actual pointer which memory was assigned to, not its parent array pointer. services.c:810:14: warning: Assigned value is garbage or undefined [core.uninitialized.Assign] **r_buf = **new_buf; ^ ~~~~~~~~~ Signed-off-by: Christian Göttsche <cgzones@xxxxxxxxxxxxxx> --- libsepol/src/services.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsepol/src/services.c b/libsepol/src/services.c index 29723729..b8fb2704 100644 --- a/libsepol/src/services.c +++ b/libsepol/src/services.c @@ -803,7 +803,7 @@ mls_ops: if (len < 0 || len >= reason_buf_len - reason_buf_used) { new_buf_len = reason_buf_len + REASON_BUF_SIZE; *new_buf = realloc(*r_buf, new_buf_len); - if (!new_buf) { + if (!*new_buf) { ERR(NULL, "failed to realloc reason buffer"); goto out1; } -- 2.35.1