mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-20 20:48:07 +00:00
fix unchecked memory allocation.
git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@719 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
This commit is contained in:
parent
ac42c95048
commit
fbc81e885d
2 changed files with 22 additions and 1 deletions
|
|
@ -75,8 +75,18 @@ typedef pthread_cond_t ortp_cond_t;
|
|||
#pragma warning(disable : 1469) // "cc" clobber ignored
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
int __ortp_thread_join(ortp_thread_t thread, void **ptr);
|
||||
int __ortp_thread_create(pthread_t *thread, pthread_attr_t *attr, void * (*routine)(void*), void *arg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#define ortp_thread_create __ortp_thread_create
|
||||
#define ortp_thread_join __ortp_thread_join
|
||||
#define ortp_thread_exit pthread_exit
|
||||
|
|
|
|||
|
|
@ -213,6 +213,12 @@ mblk_t *rtp_getq_permissive(queue_t *q,uint32_t timestamp, int *rejected)
|
|||
void
|
||||
rtp_session_init (RtpSession * session, int mode)
|
||||
{
|
||||
if (session == NULL)
|
||||
{
|
||||
ortp_debug("rtp_session_init: Invalid paramter (session=NULL)");
|
||||
return;
|
||||
}
|
||||
|
||||
JBParameters jbp;
|
||||
memset (session, 0, sizeof (RtpSession));
|
||||
session->mode = (RtpSessionMode) mode;
|
||||
|
|
@ -293,7 +299,12 @@ rtp_session_new (int mode)
|
|||
{
|
||||
RtpSession *session;
|
||||
session = (RtpSession *) ortp_malloc (sizeof (RtpSession));
|
||||
rtp_session_init (session, mode);
|
||||
if (session == NULL)
|
||||
{
|
||||
ortp_error("rtp_session_new: Memory allocation failed");
|
||||
return NULL;
|
||||
}
|
||||
rtp_session_init (session, mode);
|
||||
return session;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue