hnbap/rua: Don't usse malloc() directly but use CALLOC() macro

This commit is contained in:
Harald Welte 2015-12-18 13:41:39 +01:00
parent 9c397d4969
commit 8526d158f8
2 changed files with 2 additions and 4 deletions

View File

@ -223,11 +223,10 @@ IE_t *hnbap_new_ie(ProtocolIE_ID_t id,
IE_t *buff;
if ((buff = MALLOC(sizeof(IE_t))) == NULL) {
if ((buff = CALLOC(1, sizeof(IE_t))) == NULL) {
// Possible error on malloc
return NULL;
}
memset((void *)buff, 0, sizeof(IE_t));
buff->id = id;
buff->criticality = criticality;

View File

@ -197,11 +197,10 @@ RUA_IE_t *rua_new_ie(RUA_ProtocolIE_ID_t id,
RUA_IE_t *buff;
if ((buff = malloc(sizeof(*buff))) == NULL) {
if ((buff = CALLOC(1, sizeof(*buff))) == NULL) {
// Possible error on malloc
return NULL;
}
memset((void *)buff, 0, sizeof(*buff));
buff->id = id;
buff->criticality = criticality;