libsepol: check correct pointer for oom

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;
                                                    ^ ~~~~~~~~~

Acked-by: James Carter <jwcart2@gmail.com>
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
This commit is contained in:
Christian Göttsche 2022-04-08 15:10:51 +02:00 committed by James Carter
parent 6bc2980545
commit 68a29c3aee
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}