Module: kamailio
Branch: master
Commit: fa11a6bd50aa00994c71561b8de8b0dc8659fe55
URL:
https://github.com/kamailio/kamailio/commit/fa11a6bd50aa00994c71561b8de8b0d…
Author: Alex Hermann <alex(a)speakup.nl>
Committer: Alex Hermann <alex(a)speakup.nl>
Date: 2016-08-02T12:46:27+02:00
pv: xavp: log error message when memory allocation fails
---
Modified: modules/pv/pv_xavp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/fa11a6bd50aa00994c71561b8de8b0d…
Patch:
https://github.com/kamailio/kamailio/commit/fa11a6bd50aa00994c71561b8de8b0d…
---
diff --git a/modules/pv/pv_xavp.c b/modules/pv/pv_xavp.c
index 67ffd45..e4e94f3 100644
--- a/modules/pv/pv_xavp.c
+++ b/modules/pv/pv_xavp.c
@@ -506,8 +506,10 @@ int pv_parse_xavp_name(pv_spec_p sp, str *in)
return -1;
xname = (pv_xavp_name_t*)pkg_malloc(sizeof(pv_xavp_name_t));
- if(xname==NULL)
+ if(xname==NULL) {
+ LM_ERR("not enough pkg mem\n");
return -1;
+ }
memset(xname, 0, sizeof(pv_xavp_name_t));
@@ -530,9 +532,10 @@ int pv_parse_xavp_name(pv_spec_p sp, str *in)
xname->name.s, s.len, s.s);
xname->next = (pv_xavp_name_t*)pkg_malloc(sizeof(pv_xavp_name_t));
- if(xname->next==NULL)
+ if(xname->next==NULL) {
+ LM_ERR("not enough pkg mem\n");
goto error;
-
+ }
memset(xname->next, 0, sizeof(pv_xavp_name_t));
p = pv_xavp_fill_ni(&s, xname->next);