mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-28 06:04:20 +00:00
FS-8650 #resolve [Add switch_must_malloc/switch_must_realloc/switch_must_strdup and use it in switch_xml.c]
This commit is contained in:
1 parent
af5281e91d
commit
350a739da8
2 files changed
+95
-166
No files matched your search
@@ -227,6 +227,29 @@ struct switch_core_session;
|
||||
struct switch_core_runtime;
|
||||
struct switch_core_port_allocator;
|
||||
|
||||
|
||||
static inline void *switch_must_malloc(size_t _b)
|
||||
{
|
||||
void *m = malloc(_b);
|
||||
switch_assert(m);
|
||||
return m;
|
||||
}
|
||||
|
||||
static inline void *switch_must_realloc(void *_b, size_t _z)
|
||||
{
|
||||
void *m = realloc(_b, _z);
|
||||
switch_assert(m);
|
||||
return m;
|
||||
}
|
||||
|
||||
static inline char *switch_must_strdup(const char *_s)
|
||||
{
|
||||
char *s = strdup(_s);
|
||||
switch_assert(s);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\defgroup core1 Core Library
|
||||
\ingroup FREESWITCH
|
||||
|
||||
Reference in new issue
Block a user