fix segfault when there is a malformed registration in the db.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2322 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2006-08-18 01:23:18 +00:00
parent 72dcc8a515
commit 099a771ddf
1 changed files with 7 additions and 5 deletions

View File

@ -1000,11 +1000,13 @@ static int find_callback(void *pArg, int argc, char **argv, char **columnNames){
static int del_callback(void *pArg, int argc, char **argv, char **columnNames){ static int del_callback(void *pArg, int argc, char **argv, char **columnNames){
switch_event_t *s_event; switch_event_t *s_event;
if (switch_event_create_subclass(&s_event, SWITCH_EVENT_CUSTOM, MY_EVENT_EXPIRE) == SWITCH_STATUS_SUCCESS) { if (argc >=3 ) {
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "key", "%s", argv[0]); if (switch_event_create_subclass(&s_event, SWITCH_EVENT_CUSTOM, MY_EVENT_EXPIRE) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "url", "%s", argv[1]); switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "key", "%s", argv[0]);
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "expires", "%d", argv[2]); switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "url", "%s", argv[1]);
switch_event_fire(&s_event); switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "expires", "%d", argv[2]);
switch_event_fire(&s_event);
}
} }
return 0; return 0;
} }