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:
Anthony Minessale committed 2015-12-11 16:57:30 -06:00
1 parent af5281e91d
commit 350a739da8
2 files changed
+95 -166

No files matched your search

+23
View File
@@ -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