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:
Russell Bryant
2006-11-06 18:05:11 +00:00
parent ce40dc579c
commit 0f621aa13e

View File

@@ -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)
{
struct varz *t = calloc(1,sizeof(struct varz));
if (!t)
return;
strcpy(t->varname, varname);
strcpy(t->varval, varval);
t->next = global_varlist;