Check failed malloc
FossilOrigin-Name: a8cbc5d153043c53e759567e618c4df9052c2187cdf866cf0ef5f25eb17efeec
This commit is contained in:
parent
f1807c2867
commit
84535ae02f
@ -97,6 +97,10 @@ static struct mbag_item * get(const uint8_t *src,int len)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
uint8_t *data = malloc(len+1);
|
uint8_t *data = malloc(len+1);
|
||||||
|
if (!data){
|
||||||
|
free (item);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
*data=len;
|
*data=len;
|
||||||
memcpy(data+1,src,len);
|
memcpy(data+1,src,len);
|
||||||
item->data=data;
|
item->data=data;
|
||||||
|
Loading…
Reference in New Issue
Block a user