aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-02-08 23:45:10 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-02-08 23:45:10 +0000
commit366136de5caadd638a7e3876ab96a0930f9aa66e (patch)
tree26128bc9ae20b550bbda1bf78ad07cc939836724 /main
parent56edef47ff4ccc6a8f28ed8f0499e138b2eb3c81 (diff)
Merged revisions 245624 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r245624 | russell | 2010-02-08 17:43:00 -0600 (Mon, 08 Feb 2010) | 5 lines Fix return value of get_ie_str() and get_ie_str_hash() for non-existent IE. I found this bug while developing a unit test for event allocation. Testing is awesome. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@245625 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/event.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/event.c b/main/event.c
index 445fd40c6..dd3cff1f7 100644
--- a/main/event.c
+++ b/main/event.c
@@ -796,7 +796,7 @@ const char *ast_event_iterator_get_ie_str(struct ast_event_iterator *iterator)
str_payload = (struct ast_event_ie_str_payload *) iterator->ie->ie_payload;
- return str_payload->str;
+ return str_payload ? str_payload->str : NULL;
}
void *ast_event_iterator_get_ie_raw(struct ast_event_iterator *iterator)
@@ -824,7 +824,7 @@ uint32_t ast_event_get_ie_str_hash(const struct ast_event *event, enum ast_event
str_payload = ast_event_get_ie_raw(event, ie_type);
- return str_payload->hash;
+ return str_payload ? str_payload->hash : 0;
}
const char *ast_event_get_ie_str(const struct ast_event *event, enum ast_event_ie_type ie_type)
@@ -833,7 +833,7 @@ const char *ast_event_get_ie_str(const struct ast_event *event, enum ast_event_i
str_payload = ast_event_get_ie_raw(event, ie_type);
- return str_payload->str;
+ return str_payload ? str_payload->str : NULL;
}
const void *ast_event_get_ie_raw(const struct ast_event *event, enum ast_event_ie_type ie_type)