xmalloc_array() may return NULL if there are memory. Rather than trying
to deference it directly, we should check the return value first.
Coverity-ID:
1381852
Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Release-acked-by: Juergen Gross <jgross@suse.com>
*scontext_len = strlen(initial_sid_to_string[sid]) + 1;
scontextp = xmalloc_array(char, *scontext_len);
+ if ( !scontextp )
+ return -ENOMEM;
strlcpy(scontextp, initial_sid_to_string[sid], *scontext_len);
*scontext = scontextp;
goto out;