mirror of
https://github.com/stefanberger/swtpm.git
synced 2026-02-04 21:19:14 +00:00
swtpm_cert: Test for NULL pointer returned by malloc
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
42d5f3b50f
commit
c269da7869
@ -197,6 +197,10 @@ hex_str_to_bin(const char *hexstr, int *modulus_len)
|
||||
}
|
||||
|
||||
result = malloc(len / 2);
|
||||
if (result == NULL) {
|
||||
fprintf(stderr, "Out of memory tring to allocated %d bytes.", len / 2);
|
||||
return NULL;
|
||||
}
|
||||
i = 0;
|
||||
j = 0;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user