chg: use calloc
This commit is contained in:
1 parent
99b6087b01
commit
ad72a424ef
15 files changed
+36
-27
No files matched your search
@@ -105,7 +105,7 @@ CborError _cbor_value_dup_string(const CborValue *value, void **buffer, size_t *
|
||||
return err;
|
||||
|
||||
++*buflen;
|
||||
*buffer = malloc(*buflen);
|
||||
*buffer = calloc(*buflen, sizeof(uint8_t));
|
||||
if (!*buffer) {
|
||||
/* out of memory */
|
||||
return CborErrorOutOfMemory;
|
||||
|
||||
Reference in new issue
Block a user