mirror of
https://dev.iopsys.eu/bbf/icwmp.git
synced 2025-12-10 07:44:41 +01:00
Fix segfault in ScheduleInform
This commit is contained in:
parent
1253160a3e
commit
f178257263
1 changed files with 5 additions and 7 deletions
12
src/rpc.c
12
src/rpc.c
|
|
@ -1448,7 +1448,6 @@ int cwmp_handle_rpc_cpe_schedule_inform(struct session *session, struct rpc *rpc
|
|||
|
||||
fault = load_xml_node_data(SOAP_REQ_SCHEDINF, session->body_in, &schedinform_obj_xml_attrs);
|
||||
|
||||
FREE(command_key);
|
||||
if (fault)
|
||||
goto fault;
|
||||
|
||||
|
|
@ -1478,7 +1477,7 @@ int cwmp_handle_rpc_cpe_schedule_inform(struct session *session, struct rpc *rpc
|
|||
pthread_mutex_unlock(&mutex_schedule_inform);
|
||||
goto fault;
|
||||
}
|
||||
schedule_inform->commandKey = strdup(command_key);
|
||||
schedule_inform->commandKey = CWMP_STRDUP(command_key);
|
||||
schedule_inform->scheduled_time = scheduled_time;
|
||||
list_add(&(schedule_inform->list), ilist->prev);
|
||||
bkp_session_insert_schedule_inform(schedule_inform->scheduled_time, schedule_inform->commandKey);
|
||||
|
|
@ -1486,16 +1485,15 @@ int cwmp_handle_rpc_cpe_schedule_inform(struct session *session, struct rpc *rpc
|
|||
pthread_mutex_unlock(&mutex_schedule_inform);
|
||||
pthread_cond_signal(&threshold_schedule_inform);
|
||||
|
||||
success:
|
||||
FREE(command_key);
|
||||
return 0;
|
||||
|
||||
fault:
|
||||
FREE(command_key);
|
||||
if (cwmp_create_fault_message(session, rpc, fault ? fault : FAULT_CPE_INTERNAL_ERROR))
|
||||
goto error;
|
||||
goto success;
|
||||
|
||||
error:
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue