mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
check for failure after call to calloc() (issue #8295)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47232 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -69,6 +69,8 @@ char *find_var(const char *varname) /* the list should be pretty short, if there
|
|||||||
void set_var(const char *varname, const char *varval)
|
void set_var(const char *varname, const char *varval)
|
||||||
{
|
{
|
||||||
struct varz *t = calloc(1,sizeof(struct varz));
|
struct varz *t = calloc(1,sizeof(struct varz));
|
||||||
|
if (!t)
|
||||||
|
return;
|
||||||
strcpy(t->varname, varname);
|
strcpy(t->varname, varname);
|
||||||
strcpy(t->varval, varval);
|
strcpy(t->varval, varval);
|
||||||
t->next = global_varlist;
|
t->next = global_varlist;
|
||||||
|
Reference in New Issue
Block a user