Module: kamailio
Branch: master
Commit: 9d38aa06d645bc44e37052d9b315474a99503359
URL:
https://github.com/kamailio/kamailio/commit/9d38aa06d645bc44e37052d9b315474…
Author: Henning Westerholt <hw(a)kamailio.org>
Committer: Henning Westerholt <hw(a)kamailio.org>
Date: 2018-12-25T23:26:15+01:00
core: fix two errors introduced in commit #e3ecad34bb13e
---
Modified: src/core/str_hash.h
Modified: src/core/xavp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/9d38aa06d645bc44e37052d9b315474…
Patch:
https://github.com/kamailio/kamailio/commit/9d38aa06d645bc44e37052d9b315474…
---
diff --git a/src/core/str_hash.h b/src/core/str_hash.h
index 8c6589f449..8755a6272c 100644
--- a/src/core/str_hash.h
+++ b/src/core/str_hash.h
@@ -57,9 +57,10 @@ struct str_hash_table{
inline static int str_hash_alloc(struct str_hash_table* ht, int size)
{
ht->table=(struct str_hash_head*)pkg_malloc(sizeof(struct str_hash_head)*size);
- if (ht->table==0)
+ if (ht->table==0) {
PKG_MEM_ERROR;
return -1;
+ }
ht->size=size;
return 0;
}
diff --git a/src/core/xavp.c b/src/core/xavp.c
index 2680cf71fa..2c725e92ee 100644
--- a/src/core/xavp.c
+++ b/src/core/xavp.c
@@ -92,9 +92,10 @@ static sr_xavp_t *xavp_new_value(str *name, sr_xval_t *val)
if(val->type == SR_XTYPE_STR)
size += val->v.s.len + 1;
avp = (sr_xavp_t*)shm_malloc(size);
- if(avp==NULL)
+ if(avp==NULL) {
SHM_MEM_ERROR;
return NULL;
+ }
memset(avp, 0, size);
avp->id = id;
avp->name.s = (char*)avp + sizeof(sr_xavp_t);